From f186b390182da7af368e7a5a1e9eff8d690b7414 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Mon, 28 Sep 2015 19:27:31 +0300 Subject: eth/downloader: add fast and light sync strategies --- eth/handler_test.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'eth/handler_test.go') 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) -- cgit