mirror of https://github.com/poanetwork/quorum.git
Merge pull request #667 from kaleido-io/raft-fix-master
Check recovered sender address before including txs in the TransactionsByPriceAndNonce list
This commit is contained in:
commit
a5021ac812
|
@ -27,6 +27,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
)
|
||||
|
||||
|
@ -401,10 +402,14 @@ 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 {
|
||||
heads = append(heads, accTxs[0])
|
||||
// Ensure the sender address is from the signer
|
||||
acc, _ := Sender(signer, accTxs[0])
|
||||
txs[acc] = accTxs[1:]
|
||||
acc, err := Sender(signer, accTxs[0])
|
||||
if (err == nil) {
|
||||
heads = append(heads, accTxs[0])
|
||||
txs[acc] = accTxs[1:]
|
||||
} else {
|
||||
log.Info("Failed to recovered sender address, this transaction is skipped", "from", from, "nonce", accTxs[0].data.AccountNonce, "err", err)
|
||||
}
|
||||
if from != acc {
|
||||
delete(txs, from)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue