diff options
author | gary rong <garyrong0905@gmail.com> | 2019-02-21 21:14:35 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-02-21 21:14:35 +0800 |
commit | 7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a (patch) | |
tree | a6eb7b42652916da18091879974f0f513dd19e3d /les | |
parent | 8577b5b020d963ef9972981bbfc62b8930d3e9c9 (diff) | |
download | go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.tar go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.tar.gz go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.tar.bz2 go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.tar.lz go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.tar.xz go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.tar.zst go-tangerine-7fd0ccaa68cbc8e3f4fc59d3b99ba5067ba7c73a.zip |
core: remove unnecessary fields in logs, receipts and tx lookups (#17106)
* core: remove unnecessary fields in log
* core: bump blockchain database version
* core, les: remove unnecessary fields in txlookup
* eth: print db version explicitly
* core/rawdb: drop txlookup entry struct wrapper
Diffstat (limited to 'les')
-rw-r--r-- | les/handler.go | 4 | ||||
-rw-r--r-- | les/handler_test.go | 4 | ||||
-rw-r--r-- | les/protocol.go | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/les/handler.go b/les/handler.go index 46a1ed2d7..680e115b0 100644 --- a/les/handler.go +++ b/les/handler.go @@ -1193,9 +1193,9 @@ func (pm *ProtocolManager) txStatus(hashes []common.Hash) []txStatus { // If the transaction is unknown to the pool, try looking it up locally if stat == core.TxStatusUnknown { - if block, number, index := rawdb.ReadTxLookupEntry(pm.chainDb, hashes[i]); block != (common.Hash{}) { + if tx, blockHash, blockNumber, txIndex := rawdb.ReadTransaction(pm.chainDb, hashes[i]); tx != nil { stats[i].Status = core.TxStatusIncluded - stats[i].Lookup = &rawdb.TxLookupEntry{BlockHash: block, BlockIndex: number, Index: index} + stats[i].Lookup = &rawdb.LegacyTxLookupEntry{BlockHash: blockHash, BlockIndex: blockNumber, Index: txIndex} } } } diff --git a/les/handler_test.go b/les/handler_test.go index 72ba266b3..e9033729e 100644 --- a/les/handler_test.go +++ b/les/handler_test.go @@ -559,8 +559,8 @@ func TestTransactionStatusLes2(t *testing.T) { // check if their status is included now block1hash := rawdb.ReadCanonicalHash(db, 1) - test(tx1, false, txStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.TxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 0}}) - test(tx2, false, txStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.TxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 1}}) + test(tx1, false, txStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.LegacyTxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 0}}) + test(tx2, false, txStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.LegacyTxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 1}}) // create a reorg that rolls them back gchain, _ = core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), db, 2, func(i int, block *core.BlockGen) {}) diff --git a/les/protocol.go b/les/protocol.go index 0b24f5aed..b75f92bf7 100644 --- a/les/protocol.go +++ b/les/protocol.go @@ -221,6 +221,6 @@ type proofsData [][]rlp.RawValue type txStatus struct { Status core.TxStatus - Lookup *rawdb.TxLookupEntry `rlp:"nil"` + Lookup *rawdb.LegacyTxLookupEntry `rlp:"nil"` Error string } |