Skip to content

Commit

Permalink
eth: fix max gas price nil pointer error in replace transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kyriediculous committed Aug 22, 2021
1 parent c411195 commit 7164de8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#### General

- \#2001 fix max gas price nil pointer error in replace transaction (@kyriediculous)

#### Broadcaster

#### Orchestrator
Expand Down
2 changes: 1 addition & 1 deletion eth/transactionManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions eth/transactionManager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7164de8

Please sign in to comment.