diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-12-01 07:11:24 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-12-01 19:12:30 +0800 |
commit | 9901a40f047f55d1a756805bdeed3997d071c3d1 (patch) | |
tree | 07f07607ab2647f200b2ac17d0cbc3136e68a03f /core/chain_makers.go | |
parent | 7dde2b902cf81e90b484b1a48f6d45e0abd10e0f (diff) | |
download | dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.tar dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.tar.gz dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.tar.bz2 dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.tar.lz dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.tar.xz dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.tar.zst dexon-9901a40f047f55d1a756805bdeed3997d071c3d1.zip |
core: added a new RemovedLogEvent
When a chain reorganisation occurs we collect the logs that were deleted
during the chain reorganisation. The removed logs are posted to the
event mux indicating that those were deleted during the reorg.
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r-- | core/chain_makers.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go index 6d3152d97..4f6fa3989 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -90,6 +90,7 @@ func (b *BlockGen) AddTx(tx *types.Transaction) { if b.gasPool == nil { b.SetCoinbase(common.Address{}) } + b.statedb.StartRecord(tx.Hash(), common.Hash{}, len(b.txs)) _, gas, err := ApplyMessage(NewEnv(b.statedb, nil, tx, b.header), tx, b.gasPool) if err != nil { panic(err) @@ -97,8 +98,7 @@ func (b *BlockGen) AddTx(tx *types.Transaction) { root := b.statedb.IntermediateRoot() b.header.GasUsed.Add(b.header.GasUsed, gas) receipt := types.NewReceipt(root.Bytes(), b.header.GasUsed) - logs := b.statedb.GetLogs(tx.Hash()) - receipt.Logs = logs + receipt.Logs = b.statedb.GetLogs(tx.Hash()) receipt.Bloom = types.CreateBloom(types.Receipts{receipt}) b.txs = append(b.txs, tx) b.receipts = append(b.receipts, receipt) |