fixed saving receipts
This commit is contained in:
@ -260,9 +260,31 @@ func (sm *BlockProcessor) processWithParent(block, parent *types.Block) (logs st
|
||||
putTx(sm.extraDb, tx, block, uint64(i))
|
||||
}
|
||||
|
||||
receiptsRlp := receipts.RlpEncode()
|
||||
/*if len(receipts) > 0 {
|
||||
glog.V(logger.Info).Infof("Saving %v receipts, rlp len is %v\n", len(receipts), len(receiptsRlp))
|
||||
}*/
|
||||
sm.extraDb.Put(append(receiptsPre, block.Hash().Bytes()...), receiptsRlp)
|
||||
|
||||
return state.Logs(), nil
|
||||
}
|
||||
|
||||
func (self *BlockProcessor) GetBlockReceipts(bhash common.Hash) (receipts types.Receipts, err error) {
|
||||
var rdata []byte
|
||||
rdata, err = self.extraDb.Get(append(receiptsPre, bhash[:]...))
|
||||
|
||||
if err == nil {
|
||||
err = rlp.DecodeBytes(rdata, &receipts)
|
||||
} else {
|
||||
glog.V(logger.Detail).Infof("GetBlockReceipts error %v\n", err)
|
||||
}
|
||||
/*if len(receipts) > 0 {
|
||||
glog.V(logger.Info).Infof("GBR len %v\n", len(receipts))
|
||||
}*/
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
// See YP section 4.3.4. "Block Header Validity"
|
||||
// Validates a block. Returns an error if the block is invalid.
|
||||
func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header, checkPow bool) error {
|
||||
|
Reference in New Issue
Block a user