This commit is contained in:
Jordan Krage 2018-07-31 07:53:20 +00:00 committed by GitHub
commit 9ad8d496ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -331,6 +331,7 @@ func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transa
// Initialize a price based heap with the head transactions
heads := make(TxByPrice, 0, len(txs))
for from, accTxs := range txs {
if len(accTxs) > 0 {
heads = append(heads, accTxs[0])
// Ensure the sender address is from the signer
acc, _ := Sender(signer, accTxs[0])
@ -339,6 +340,7 @@ func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transa
delete(txs, from)
}
}
}
heap.Init(&heads)
// Assemble and return the transaction set