Skip to content

Commit

Permalink
disallow empty from address at estimate fee
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 23, 2024
1 parent 5afc565 commit e43830f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsonrpc/backend/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func (b *JSONRPCBackend) EstimateGas(args rpctypes.TransactionArgs, blockNrOrHas
if overrides != nil {
return hexutil.Uint64(0), errors.New("state overrides are not supported")
}
if args.From == nil {
return hexutil.Uint64(0), errors.New("empty from address is not allowed from the estimate gas")
}

if args.Nonce == nil && args.From != nil {
nonce, err := b.GetTransactionCount(*args.From, rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber))
Expand Down

0 comments on commit e43830f

Please sign in to comment.