diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 81bbe7cc2b..76b8996efb 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -21,6 +21,8 @@ #### General +- \#2001 fix max gas price nil pointer error in replace transaction (@kyriediculous) + #### Broadcaster #### Orchestrator diff --git a/eth/transactionManager.go b/eth/transactionManager.go index 2ebc996cf8..cd2161d9cc 100644 --- a/eth/transactionManager.go +++ b/eth/transactionManager.go @@ -166,7 +166,7 @@ func (tm *TransactionManager) replace(tx *types.Transaction) (*types.Transaction // Bump gas price exceeds max gas price, return early max := tm.gpm.MaxGasPrice() - if gasPrice.Cmp(max) > 0 { + if max != nil && gasPrice.Cmp(max) > 0 { return nil, fmt.Errorf("replacement gas price exceeds max gas price suggested=%v max=%v", gasPrice, max) } diff --git a/eth/transactionManager_test.go b/eth/transactionManager_test.go index ab4280de4a..aee3f34ca8 100644 --- a/eth/transactionManager_test.go +++ b/eth/transactionManager_test.go @@ -209,6 +209,7 @@ func TestTransactionManager_Replace(t *testing.T) { ) // Error signing replacement tx + gpm.maxGasPrice = nil expErr = errors.New("SignTx error") sig := &stubTransactionSigner{ err: nil,