From 499f682b48f914ed4af0e32ba446dd0cf56e96b4 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 14 Aug 2019 15:19:28 -0400 Subject: allow manual block generation --- examples/payments/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples') 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) -- cgit v1.2.3-70-g09d2