aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api_backend.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-02-22 18:48:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-02-23 01:12:43 +0800
commit5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161 (patch)
tree10c38cbf3cd5a0e796d6df6c667cc84ce57e2a34 /eth/api_backend.go
parent45352477933d71ec5055504da74547b0cdf0274b (diff)
downloadgo-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.tar
go-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.tar.gz
go-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.tar.bz2
go-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.tar.lz
go-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.tar.xz
go-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.tar.zst
go-tangerine-5cf1d354704cd2cbc5c64c96d4aaabeeec7dd161.zip
eth, les, light: filter on logs only, derive receipts on demand
Diffstat (limited to 'eth/api_backend.go')
-rw-r--r--eth/api_backend.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index 91f392f94..ecd5488a2 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -104,6 +104,18 @@ func (b *EthApiBackend) GetReceipts(ctx context.Context, blockHash common.Hash)
return core.GetBlockReceipts(b.eth.chainDb, blockHash, core.GetBlockNumber(b.eth.chainDb, blockHash)), nil
}
+func (b *EthApiBackend) GetLogs(ctx context.Context, blockHash common.Hash) ([][]*types.Log, error) {
+ receipts := core.GetBlockReceipts(b.eth.chainDb, blockHash, core.GetBlockNumber(b.eth.chainDb, blockHash))
+ if receipts == nil {
+ return nil, nil
+ }
+ logs := make([][]*types.Log, len(receipts))
+ for i, receipt := range receipts {
+ logs[i] = receipt.Logs
+ }
+ return logs, nil
+}
+
func (b *EthApiBackend) GetTd(blockHash common.Hash) *big.Int {
return b.eth.blockchain.GetTdByHash(blockHash)
}