diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-03 09:01:31 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-03 09:01:31 +0800 |
commit | 5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2 (patch) | |
tree | c6bcde3434499f2435a87480b142e16867ca6e67 /ethereum.go | |
parent | ec883db3b1172f75761c066d4b022858d1f9df5d (diff) | |
download | dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.tar dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.tar.gz dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.tar.bz2 dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.tar.lz dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.tar.xz dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.tar.zst dexon-5e36e3ccc7fad6d0b40c7f95be4f02e0cafdb2e2.zip |
Process transactions
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ethereum.go b/ethereum.go index bae473854..680e52325 100644 --- a/ethereum.go +++ b/ethereum.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/eth-go" "github.com/ethereum/ethchain-go" "github.com/ethereum/ethutil-go" + "github.com/ethereum/ethwire-go" "log" "os" "os/signal" @@ -88,16 +89,11 @@ func main() { // Create a new block which we're going to mine block := ethereum.BlockManager.BlockChain().NewBlock(addr, txs) // Apply all transactions to the block - ethereum.BlockManager.ApplyTransactions(block) + ethereum.BlockManager.ApplyTransactions(block, block.Transactions()) // Search the nonce block.Nonce = pow.Search(block) - // Process the block and verify - err := ethereum.BlockManager.ProcessBlock(block) - if err != nil { - log.Println(err) - } else { - log.Println("\n+++++++ MINED BLK +++++++\n", block.String()) - } + ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{block.RlpValue().Value}) + log.Println("\n+++++++ MINED BLK +++++++\n", block.String()) } }() } |