Merge pull request #16285 from karalabe/fix-resend-optional-param

internal/ethapi: make resent gas params optional
This commit is contained in:
Péter Szilágyi 2018-03-08 12:52:38 +02:00 committed by GitHub
commit 85d5f2c661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1337,10 +1337,10 @@ func (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs SendTxAr
if pFrom, err := types.Sender(signer, p); err == nil && pFrom == sendArgs.From && signer.Hash(p) == wantSigHash { if pFrom, err := types.Sender(signer, p); err == nil && pFrom == sendArgs.From && signer.Hash(p) == wantSigHash {
// Match. Re-sign and send the transaction. // Match. Re-sign and send the transaction.
if gasPrice != nil { if gasPrice != nil && (*big.Int)(gasPrice).Sign() != 0 {
sendArgs.GasPrice = gasPrice sendArgs.GasPrice = gasPrice
} }
if gasLimit != nil { if gasLimit != nil && *gasLimit != 0 {
sendArgs.Gas = gasLimit sendArgs.Gas = gasLimit
} }
signedTx, err := s.sign(sendArgs.From, sendArgs.toTransaction()) signedTx, err := s.sign(sendArgs.From, sendArgs.toTransaction())