diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-09-29 00:27:31 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-10-19 15:03:09 +0800 |
commit | f186b390182da7af368e7a5a1e9eff8d690b7414 (patch) | |
tree | feb1410fe848dae9eed22c585bc0ebaab713f5a1 /eth/handler_test.go | |
parent | c33cc382b3561ca91871111933f81653bfd8532f (diff) | |
download | dexon-f186b390182da7af368e7a5a1e9eff8d690b7414.tar.gz dexon-f186b390182da7af368e7a5a1e9eff8d690b7414.tar.zst dexon-f186b390182da7af368e7a5a1e9eff8d690b7414.zip |
eth/downloader: add fast and light sync strategies
Diffstat (limited to 'eth/handler_test.go')
-rw-r--r-- | eth/handler_test.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/eth/handler_test.go b/eth/handler_test.go index 8ab5c1aad..5ddfc4a8f 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -535,15 +535,12 @@ func testGetReceipt(t *testing.T, protocol int) { defer peer.close() // Collect the hashes to request, and the response to expect - hashes := []common.Hash{} + hashes, receipts := []common.Hash{}, []types.Receipts{} for i := uint64(0); i <= pm.blockchain.CurrentBlock().NumberU64(); i++ { - for _, tx := range pm.blockchain.GetBlockByNumber(i).Transactions() { - hashes = append(hashes, tx.Hash()) - } - } - receipts := make([]*types.Receipt, len(hashes)) - for i, hash := range hashes { - receipts[i] = core.GetReceipt(pm.chaindb, hash) + block := pm.blockchain.GetBlockByNumber(i) + + hashes = append(hashes, block.Hash()) + receipts = append(receipts, core.GetBlockReceipts(pm.chaindb, block.Hash())) } // Send the hash request and verify the response p2p.Send(peer.app, 0x0f, hashes) |