File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -970,8 +970,9 @@ func (pool *TxPool) AddRemotes(txs []*types.Transaction) []error {
970970
971971// addTx enqueues a single transaction into the pool if it is valid.
972972func (pool * TxPool ) addTx (tx * types.Transaction , local bool ) error {
973- tx .CacheHash ()
974- types .CacheSigner (pool .signer , tx )
973+ // Cache sender in transaction before obtaining lock (pool.signer is immutable)
974+ types .Sender (pool .signer , tx )
975+
975976 pool .mu .Lock ()
976977 defer pool .mu .Unlock ()
977978
@@ -990,6 +991,10 @@ func (pool *TxPool) addTx(tx *types.Transaction, local bool) error {
990991
991992// addTxs attempts to queue a batch of transactions if they are valid.
992993func (pool * TxPool ) addTxs (txs []* types.Transaction , local bool ) []error {
994+ // Cache senders in transactions before obtaining lock (pool.signer is immutable)
995+ for _ , tx := range txs {
996+ types .Sender (pool .signer , tx )
997+ }
993998 pool .mu .Lock ()
994999 defer pool .mu .Unlock ()
9951000
You can’t perform that action at this time.
0 commit comments