aboutsummaryrefslogtreecommitdiffstats
path: root/core/block_processor.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-15 00:18:09 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-15 00:40:03 +0800
commite17d8ddbeb01a7e3eb745431d39c93661e167bbc (patch)
treef8814669fc41f220bc1173b58fdf23f27ce609ca /core/block_processor.go
parent796c18db93add1d145db99d6088e445a56851e8b (diff)
downloadgo-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.tar
go-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.tar.gz
go-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.tar.bz2
go-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.tar.lz
go-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.tar.xz
go-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.tar.zst
go-tangerine-e17d8ddbeb01a7e3eb745431d39c93661e167bbc.zip
core: during chain reorg rewrite receipts and transactions
Added PutBlockReceipts; storing receipts by blocks. Eventually this will require pruning during some cleanup cycle. During forks the receipts by block are used to get the new canonical receipts and transactions. This PR fixes #1473 by rewriting transactions and receipts from the point of where the fork occured.
Diffstat (limited to 'core/block_processor.go')
-rw-r--r--core/block_processor.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index f50ebb55a..e24b290dd 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -342,7 +342,7 @@ func (sm *BlockProcessor) VerifyUncles(statedb *state.StateDB, block, parent *ty
// GetBlockReceipts returns the receipts beloniging to the block hash
func (sm *BlockProcessor) GetBlockReceipts(bhash common.Hash) types.Receipts {
if block := sm.ChainManager().GetBlock(bhash); block != nil {
- return GetReceiptsFromBlock(sm.extraDb, block)
+ return GetBlockReceipts(sm.extraDb, block.Hash())
}
return nil
@@ -352,7 +352,7 @@ func (sm *BlockProcessor) GetBlockReceipts(bhash common.Hash) types.Receipts {
// where it tries to get it from the (updated) method which gets them from the receipts or
// the depricated way by re-processing the block.
func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err error) {
- receipts := GetReceiptsFromBlock(sm.extraDb, block)
+ receipts := GetBlockReceipts(sm.extraDb, block.Hash())
if len(receipts) > 0 {
// coalesce logs
for _, receipt := range receipts {