diff options
author | obscuren <geffobscura@gmail.com> | 2014-03-31 07:02:00 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-03-31 07:02:00 +0800 |
commit | e403b28eea6959c1d0ed003d955df3dee586083b (patch) | |
tree | c9f53075f65572c362664a6e40567c02bce8608a | |
parent | 97b98b1250890977ea622af378fe864e4620e313 (diff) | |
download | dexon-e403b28eea6959c1d0ed003d955df3dee586083b.tar.gz dexon-e403b28eea6959c1d0ed003d955df3dee586083b.tar.zst dexon-e403b28eea6959c1d0ed003d955df3dee586083b.zip |
Fixed miner
-rw-r--r-- | ethereum/ethereum.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ethereum/ethereum.go b/ethereum/ethereum.go index 3f5e4a8f5..666c75117 100644 --- a/ethereum/ethereum.go +++ b/ethereum/ethereum.go @@ -131,15 +131,14 @@ func main() { // Create a new block which we're going to mine block := ethereum.BlockChain().NewBlock(addr, txs) log.Println("Mining on new block. Includes", len(block.Transactions()), "transactions") - // Apply all transactions to the block - ethereum.StateManager().ApplyTransactions(block, block.Transactions()) ethereum.StateManager().Prepare(block.State(), block.State()) + // Apply all transactions to the block + ethereum.StateManager().ApplyTransactions(block, block.Transactions()) ethereum.StateManager().AccumelateRewards(block) // Search the nonce block.Nonce = pow.Search(block) - ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{block.Value().Val}) ethereum.StateManager().PrepareDefault(block) err := ethereum.StateManager().ProcessBlock(block) @@ -148,6 +147,7 @@ func main() { } else { log.Println("\n+++++++ MINED BLK +++++++\n", ethereum.BlockChain().CurrentBlock) log.Printf("🔨 Mined block %x\n", block.Hash()) + ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{block.Value().Val}) } } }() |