diff options
author | Sonic <sonic@dexon.org> | 2019-03-27 20:02:55 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-13 18:11:44 +0800 |
commit | c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8 (patch) | |
tree | aa9e20f32fa084fd9c5e2fbfcee295d5d63b1d48 /dex/api_backend.go | |
parent | 7b8b4fcb0e8fd411bf523d06492e966e20e1b613 (diff) | |
download | go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.tar go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.tar.gz go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.tar.bz2 go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.tar.lz go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.tar.xz go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.tar.zst go-tangerine-c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8.zip |
backport from v1.8.23 (#304)
* dex: backport f6193ad
* dex/downloader: backport accc0fa accc0fab 174083c3
* dex: backport 434dd5b
* dex: backport 42a914a 0983d02
* dex: backport 48b70ec 31b3334 and some modification
* dex/downloader: backport 5f251a6
* dex/downloader: backport 81c3dc7
* dex, dex/downloader: fix typos
Diffstat (limited to 'dex/api_backend.go')
-rw-r--r-- | dex/api_backend.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/dex/api_backend.go b/dex/api_backend.go index 60a874701..7333a9bb1 100644 --- a/dex/api_backend.go +++ b/dex/api_backend.go @@ -25,7 +25,6 @@ import ( "github.com/dexon-foundation/dexon/common/math" "github.com/dexon-foundation/dexon/core" "github.com/dexon-foundation/dexon/core/bloombits" - "github.com/dexon-foundation/dexon/core/rawdb" "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" "github.com/dexon-foundation/dexon/core/vm" @@ -92,18 +91,11 @@ func (b *DexAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types. } func (b *DexAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) { - if number := rawdb.ReadHeaderNumber(b.dex.chainDb, hash); number != nil { - return rawdb.ReadReceipts(b.dex.chainDb, hash, *number), nil - } - return nil, nil + return b.dex.blockchain.GetReceiptsByHash(hash), nil } func (b *DexAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) { - number := rawdb.ReadHeaderNumber(b.dex.chainDb, hash) - if number == nil { - return nil, nil - } - receipts := rawdb.ReadReceipts(b.dex.chainDb, hash, *number) + receipts := b.dex.blockchain.GetReceiptsByHash(hash) if receipts == nil { return nil, nil } |