diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-04 23:44:43 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-04 23:44:43 +0800 |
commit | a5b27bbc10d6a145152fc2629043c46ef4a9ca71 (patch) | |
tree | 9752704f0f3f310f382d75438d2c71ff73fbe16c /core/block_manager.go | |
parent | 8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c (diff) | |
download | go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.tar go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.tar.gz go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.tar.bz2 go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.tar.lz go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.tar.xz go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.tar.zst go-tangerine-a5b27bbc10d6a145152fc2629043c46ef4a9ca71.zip |
Improved and simplified wallet functions and behaviour
Diffstat (limited to 'core/block_manager.go')
-rw-r--r-- | core/block_manager.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/block_manager.go b/core/block_manager.go index c2ffc7ae0..b648166ec 100644 --- a/core/block_manager.go +++ b/core/block_manager.go @@ -123,7 +123,7 @@ func (sm *BlockManager) TransitionState(statedb *state.StateDB, parent, block *t coinbase.SetGasPool(block.CalcGasLimit(parent)) // Process the transactions on to current block - receipts, _, _, _, err = sm.ProcessTransactions(coinbase, statedb, block, parent, block.Transactions()) + receipts, _, _, _, err = sm.ApplyTransactions(coinbase, statedb, block, block.Transactions(), false) if err != nil { return nil, err } @@ -131,7 +131,7 @@ func (sm *BlockManager) TransitionState(statedb *state.StateDB, parent, block *t return receipts, nil } -func (self *BlockManager) ProcessTransactions(coinbase *state.StateObject, state *state.StateDB, block, parent *types.Block, txs types.Transactions) (types.Receipts, types.Transactions, types.Transactions, types.Transactions, error) { +func (self *BlockManager) ApplyTransactions(coinbase *state.StateObject, state *state.StateDB, block *types.Block, txs types.Transactions, transientProcess bool) (types.Receipts, types.Transactions, types.Transactions, types.Transactions, error) { var ( receipts types.Receipts handled, unhandled types.Transactions @@ -180,7 +180,9 @@ done: receipt.Bloom = types.CreateBloom(types.Receipts{receipt}) // Notify all subscribers - go self.eth.EventMux().Post(TxPostEvent{tx}) + if !transientProcess { + go self.eth.EventMux().Post(TxPostEvent{tx}) + } receipts = append(receipts, receipt) handled = append(handled, tx) @@ -378,7 +380,7 @@ func (sm *BlockManager) AccumelateRewards(statedb *state.StateDB, block, parent account.AddAmount(reward) statedb.Manifest().AddMessage(&state.Message{ - To: block.Coinbase, From: block.Coinbase, + To: block.Coinbase, Input: nil, Origin: nil, Block: block.Hash(), Timestamp: block.Time, Coinbase: block.Coinbase, Number: block.Number, |