|
|
|
@ -8,7 +8,6 @@ import ( |
|
|
|
|
"github.com/ethereum/ethutil-go" |
|
|
|
|
_ "github.com/ethereum/ethwire-go" |
|
|
|
|
"log" |
|
|
|
|
"math/big" |
|
|
|
|
"os" |
|
|
|
|
"os/signal" |
|
|
|
|
"path" |
|
|
|
@ -89,11 +88,19 @@ func main() { |
|
|
|
|
|
|
|
|
|
// Fake block mining. It broadcasts a new block every 5 seconds
|
|
|
|
|
go func() { |
|
|
|
|
pow := ðchain.EasyPow{} |
|
|
|
|
|
|
|
|
|
for { |
|
|
|
|
txs := ethereum.TxPool.Flush() |
|
|
|
|
block := ethereum.BlockManager.BlockChain().NewBlock("82c3b0b72cf62f1a9ce97c64da8072efa28225d8", txs) |
|
|
|
|
|
|
|
|
|
nonce := pow.Search(block) |
|
|
|
|
block.Nonce = nonce |
|
|
|
|
|
|
|
|
|
log.Println("nonce found:", nonce) |
|
|
|
|
/* |
|
|
|
|
time.Sleep(blockTime * time.Second) |
|
|
|
|
|
|
|
|
|
txs := ethereum.TxPool.Flush() |
|
|
|
|
|
|
|
|
|
block := ethchain.CreateBlock( |
|
|
|
|
ethereum.BlockManager.BlockChain().CurrentBlock.State().Root, |
|
|
|
@ -109,6 +116,7 @@ func main() { |
|
|
|
|
} else { |
|
|
|
|
//log.Println("\n+++++++ MINED BLK +++++++\n", block.String())
|
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |
|
|
|
|
}() |
|
|
|
|
} |
|
|
|
|