Skip to content

Commit

Permalink
core/types: avoid duplicating transactions on changing signer (ethere…
Browse files Browse the repository at this point in the history
  • Loading branch information
countvonzero authored and firmianavan committed Aug 28, 2018
1 parent 7be40d2 commit 00bdcac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,14 @@ type TransactionsByPriceAndNonce struct {
func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByPriceAndNonce {
// Initialize a price based heap with the head transactions
heads := make(TxByPrice, 0, len(txs))
for _, accTxs := range txs {
for from, accTxs := range txs {
heads = append(heads, accTxs[0])
// Ensure the sender address is from the signer
acc, _ := Sender(signer, accTxs[0])
txs[acc] = accTxs[1:]
if from != acc {
delete(txs, from)
}
}
heap.Init(&heads)

Expand Down

0 comments on commit 00bdcac

Please sign in to comment.