|
|
@ -892,11 +892,7 @@ func (pool *TxPool) AddLocals(txs []*types.Transaction) []error { |
|
|
|
// If the senders are not among the locally tracked ones, full pricing constraints
|
|
|
|
// If the senders are not among the locally tracked ones, full pricing constraints
|
|
|
|
// will apply.
|
|
|
|
// will apply.
|
|
|
|
func (pool *TxPool) AddRemotes(txs []*types.Transaction) []error { |
|
|
|
func (pool *TxPool) AddRemotes(txs []*types.Transaction) []error { |
|
|
|
errs := []error{} |
|
|
|
return pool.addTxs(txs, false) |
|
|
|
for _, err := range pool.addTxs(txs, false) { |
|
|
|
|
|
|
|
errs = append(errs, errors.Cause(err)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return errs |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// addTx enqueues a single transaction into the pool if it is valid.
|
|
|
|
// addTx enqueues a single transaction into the pool if it is valid.
|
|
|
@ -937,14 +933,15 @@ func (pool *TxPool) addTxsLocked(txs []*types.Transaction, local bool) []error { |
|
|
|
erroredTxns := []types.RPCTransactionError{} |
|
|
|
erroredTxns := []types.RPCTransactionError{} |
|
|
|
|
|
|
|
|
|
|
|
for i, tx := range txs { |
|
|
|
for i, tx := range txs { |
|
|
|
var replace bool |
|
|
|
replace, err := pool.add(tx, local) |
|
|
|
if replace, errs[i] = pool.add(tx, local); errs[i] == nil && !replace { |
|
|
|
if err == nil && !replace { |
|
|
|
from, _ := types.Sender(pool.signer, tx) // already validated
|
|
|
|
from, _ := types.Sender(pool.signer, tx) // already validated
|
|
|
|
dirty[from] = struct{}{} |
|
|
|
dirty[from] = struct{}{} |
|
|
|
} |
|
|
|
} |
|
|
|
if errs[i] != nil && errors.Cause(errs[i]) != ErrKnownTransaction { |
|
|
|
if err != nil && err != ErrKnownTransaction { |
|
|
|
erroredTxns = append(erroredTxns, *types.NewRPCTransactionError(tx.Hash(), errs[i])) |
|
|
|
erroredTxns = append(erroredTxns, *types.NewRPCTransactionError(tx.Hash(), err)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
errs[i] = errors.Cause(err) |
|
|
|
} |
|
|
|
} |
|
|
|
// Only reprocess the internal state if something was actually added
|
|
|
|
// Only reprocess the internal state if something was actually added
|
|
|
|
if len(dirty) > 0 { |
|
|
|
if len(dirty) > 0 { |
|
|
|