diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-03 06:52:06 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-03 06:52:06 +0800 |
commit | 7f8f008253c9928b556df238984f3046304be86e (patch) | |
tree | b3769b96a7e5775672bea5d6e04b86d07d5303c8 /ethereum.go | |
parent | c3ee0e92b8f782aa51eae384d05d62f0ea9b753d (diff) | |
download | dexon-7f8f008253c9928b556df238984f3046304be86e.tar dexon-7f8f008253c9928b556df238984f3046304be86e.tar.gz dexon-7f8f008253c9928b556df238984f3046304be86e.tar.bz2 dexon-7f8f008253c9928b556df238984f3046304be86e.tar.lz dexon-7f8f008253c9928b556df238984f3046304be86e.tar.xz dexon-7f8f008253c9928b556df238984f3046304be86e.tar.zst dexon-7f8f008253c9928b556df238984f3046304be86e.zip |
Changed mining
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ethereum.go b/ethereum.go index 6d6d25bd4..74c545edc 100644 --- a/ethereum.go +++ b/ethereum.go @@ -7,12 +7,10 @@ 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" "runtime" - "time" ) const Debug = true @@ -78,8 +76,7 @@ func main() { ethereum.Start() if StartMining { - blockTime := time.Duration(10) - log.Printf("Dev Test Mining started. Blocks found each %d seconds\n", blockTime) + log.Printf("Dev Test Mining started...\n") // Fake block mining. It broadcasts a new block every 5 seconds go func() { @@ -87,13 +84,12 @@ func main() { addr, _ := hex.DecodeString("82c3b0b72cf62f1a9ce97c64da8072efa28225d8") for { - time.Sleep(blockTime * time.Second) + //time.Sleep(blockTime * time.Second) txs := ethereum.TxPool.Flush() block := ethereum.BlockManager.BlockChain().NewBlock(addr, txs) - nonce := pow.Search(block) - block.Nonce = nonce + block.Nonce = pow.Search(block) err := ethereum.BlockManager.ProcessBlockWithState(block, block.State()) if err != nil { |