diff options
author | Determinant <[email protected]> | 2019-08-14 15:19:28 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-08-14 15:19:28 -0400 |
commit | 499f682b48f914ed4af0e32ba446dd0cf56e96b4 (patch) | |
tree | 62bbe47ce4f1de674fbca9c16709c98e729b08ec /examples | |
parent | 485da638c7b3ecd2e23299252848d99258fb6727 (diff) |
allow manual block generation
Diffstat (limited to 'examples')
-rw-r--r-- | examples/payments/main.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/payments/main.go b/examples/payments/main.go index 3e675ac..9609359 100644 --- a/examples/payments/main.go +++ b/examples/payments/main.go @@ -55,6 +55,8 @@ func main() { Alloc: core.GenesisAlloc{ genKey.Address: { Balance: genBalance }}, } + config.Miner.ManualMining = true + chainID := chainConfig.ChainID nonce := uint64(1) value := big.NewInt(1000000000000) @@ -69,8 +71,9 @@ func main() { tx := types.NewTransaction(nonce, bob.Address, value, uint64(gasLimit), gasPrice, nil) signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), genKey.PrivateKey); checkError(err) chain.AddLocalTxs([]*types.Transaction{signedTx}) - time.Sleep(5000 * time.Millisecond) + time.Sleep(1000 * time.Millisecond) nonce++ + chain.GenBlock() } c := make(chan os.Signal, 1) |