aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-08-14 15:19:28 -0400
committerDeterminant <[email protected]>2019-08-14 15:19:28 -0400
commit499f682b48f914ed4af0e32ba446dd0cf56e96b4 (patch)
tree62bbe47ce4f1de674fbca9c16709c98e729b08ec /examples
parent485da638c7b3ecd2e23299252848d99258fb6727 (diff)
allow manual block generation
Diffstat (limited to 'examples')
-rw-r--r--examples/payments/main.go5
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)