From 92929a98dfd662f860feefe76ff824fdf9ce76a3 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Sat, 6 Apr 2019 11:51:59 +0800 Subject: cmd: monkey: use suggested gas price --- cmd/zoo/monkey/monkey.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/zoo/monkey/monkey.go b/cmd/zoo/monkey/monkey.go index 2afffa87c..a511c42fa 100644 --- a/cmd/zoo/monkey/monkey.go +++ b/cmd/zoo/monkey/monkey.go @@ -124,16 +124,21 @@ func (m *Monkey) prepareTx(ctx *transferContext) *types.Transaction { } } + gasPrice, err := m.client.SuggestGasPrice(context.Background()) + if err != nil { + panic(err) + } + tx := types.NewTransaction( ctx.Nonce, ctx.ToAddress, ctx.Amount, ctx.Gas, - big.NewInt(1e9), + gasPrice, ctx.Data) signer := types.NewEIP155Signer(m.networkID) - tx, err := types.SignTx(tx, signer, ctx.Key) + tx, err = types.SignTx(tx, signer, ctx.Key) if err != nil { panic(err) } -- cgit