Skip to content

Commit

Permalink
Handle transaction ordering in cases where tx ids are off by more tha…
Browse files Browse the repository at this point in the history
…n 1 in tx-state-manager
  • Loading branch information
danjm committed Nov 26, 2019
1 parent 36ade8b commit ccd7e62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/scripts/controllers/transactions/tx-state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ class TransactionStateManager extends EventEmitter {
transactions.splice(index, 1)
}
}
const newTxIndex = transactions.findIndex((metaTx) => {
return metaTx.id === txMeta.id + 1
})
const newTxIndex = transactions
.findIndex((currentTxMeta) => currentTxMeta.id > txMeta.id)

newTxIndex === -1
? transactions.push(txMeta)
: transactions.splice(newTxIndex, 0, txMeta)
Expand Down

0 comments on commit ccd7e62

Please sign in to comment.