Skip to content

Commit

Permalink
upgrade gaslimit to *1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-zxn committed Jul 1, 2022
1 parent 53dae69 commit f4ffa08
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
type Config struct {
ChainId uint64
KeyStoreProviders []*KeyStoreProviderConfig
KeyProviders []string
Nodes []string

// NEO wallet
Expand Down Expand Up @@ -324,6 +325,7 @@ func (w *Wallet) SendWithMaxLimit(account accounts.Account, addr common.Address,
return
}

limit = uint64(1.1 * float32(limit))
if maxLimit.Cmp(new(big.Int).Mul(big.NewInt(int64(limit)), gasPrice)) == -1 {
nonces.Update(false)
err = fmt.Errorf("Send tx estimated gas (limit %v, price %s) higher than max limit %s", limit, gasPrice, maxLimit)
Expand Down

0 comments on commit f4ffa08

Please sign in to comment.