mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
mempool: Optimize pool double spend check.
This optimizes `checkPoolDoubleSpend` to check the traversal position first since it is more likely.
This commit is contained in:
parent
353f84e75a
commit
bc63bf40d1
@ -706,8 +706,7 @@ func (mp *TxPool) addTransaction(utxoView *blockchain.UtxoViewpoint,
|
||||
func (mp *TxPool) checkPoolDoubleSpend(tx *dcrutil.Tx, txType stake.TxType) error {
|
||||
for i, txIn := range tx.MsgTx().TxIn {
|
||||
// We don't care about double spends of stake bases.
|
||||
if (txType == stake.TxTypeSSGen || txType == stake.TxTypeSSRtx) &&
|
||||
(i == 0) {
|
||||
if i == 0 && (txType == stake.TxTypeSSGen || txType == stake.TxTypeSSRtx) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user