This commit is contained in:
Ori Newman 2023-09-25 06:57:39 +03:00
parent d3627de7f8
commit 4f04923114

View File

@ -166,20 +166,21 @@ func (mp *mempool) BlockCandidateTransactions() []*externalapi.DomainTransaction
if hasCoinbaseInput || tx.Fee > uint64(numExtraOuts)*constants.SompiPerKaspa { if hasCoinbaseInput || tx.Fee > uint64(numExtraOuts)*constants.SompiPerKaspa {
candidateTxs = append(candidateTxs, tx) candidateTxs = append(candidateTxs, tx)
} else { } else {
if spamTx != nil { txNewestUTXODaaScore := tx.Inputs[0].UTXOEntry.BlockDAAScore()
txNewestUTXODaaScore := tx.Inputs[0].UTXOEntry.BlockDAAScore() for _, input := range tx.Inputs {
for _, input := range tx.Inputs { if input.UTXOEntry.BlockDAAScore() > txNewestUTXODaaScore {
if input.UTXOEntry.BlockDAAScore() > txNewestUTXODaaScore { txNewestUTXODaaScore = input.UTXOEntry.BlockDAAScore()
txNewestUTXODaaScore = input.UTXOEntry.BlockDAAScore()
}
} }
}
if spamTx != nil {
if txNewestUTXODaaScore < spamTxNewestUTXODaaScore { if txNewestUTXODaaScore < spamTxNewestUTXODaaScore {
spamTx = tx spamTx = tx
spamTxNewestUTXODaaScore = txNewestUTXODaaScore spamTxNewestUTXODaaScore = txNewestUTXODaaScore
} }
} else { } else {
spamTx = tx spamTx = tx
spamTxNewestUTXODaaScore = txNewestUTXODaaScore
} }
} }
} else { } else {