mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
core: delete entry from txs after adding correct sender
This commit is contained in:
parent
933972d139
commit
fead959e38
1 changed files with 4 additions and 1 deletions
|
|
@ -393,11 +393,14 @@ type TransactionsByPriceAndNonce struct {
|
||||||
func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByPriceAndNonce {
|
func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByPriceAndNonce {
|
||||||
// Initialize a price based heap with the head transactions
|
// Initialize a price based heap with the head transactions
|
||||||
heads := make(TxByPrice, 0, len(txs))
|
heads := make(TxByPrice, 0, len(txs))
|
||||||
for _, accTxs := range txs {
|
for from, accTxs := range txs {
|
||||||
heads = append(heads, accTxs[0])
|
heads = append(heads, accTxs[0])
|
||||||
// Ensure the sender address is from the signer
|
// Ensure the sender address is from the signer
|
||||||
acc, _ := Sender(signer, accTxs[0])
|
acc, _ := Sender(signer, accTxs[0])
|
||||||
txs[acc] = accTxs[1:]
|
txs[acc] = accTxs[1:]
|
||||||
|
if from != acc {
|
||||||
|
delete(txs, from)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
heap.Init(&heads)
|
heap.Init(&heads)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue