aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 54378b2b9..0ed30ca21 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -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 {