eth/downloader: add fast and light sync strategies

This commit is contained in:
Péter Szilágyi
2015-09-28 19:27:31 +03:00
parent c33cc382b3
commit f186b39018
11 changed files with 1456 additions and 828 deletions

View File

@ -140,13 +140,12 @@ func GetBlockReceipts(db ethdb.Database, hash common.Hash) types.Receipts {
if len(data) == 0 {
return nil
}
var receipts types.Receipts
err := rlp.DecodeBytes(data, &receipts)
if err != nil {
glog.V(logger.Core).Infoln("GetReceiptse err", err)
receipts := new(types.Receipts)
if err := rlp.DecodeBytes(data, receipts); err != nil {
glog.V(logger.Error).Infof("invalid receipt array RLP for hash %x: %v", hash, err)
return nil
}
return receipts
return *receipts
}
// PutBlockReceipts stores the block's transactions associated receipts