Skip to content

Commit cdb14d7

Browse files
committed
[net processing] Use HasWitness over comparing (w)txids
1 parent dcf6230 commit cdb14d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ void PeerManagerImpl::BlockConnected(const std::shared_ptr<const CBlock>& pblock
18521852
LOCK(m_recent_confirmed_transactions_mutex);
18531853
for (const auto& ptx : pblock->vtx) {
18541854
m_recent_confirmed_transactions.insert(ptx->GetHash());
1855-
if (ptx->GetHash() != ptx->GetWitnessHash()) {
1855+
if (ptx->HasWitness()) {
18561856
m_recent_confirmed_transactions.insert(ptx->GetWitnessHash());
18571857
}
18581858
}
@@ -2976,7 +2976,7 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
29762976
// processing of this transaction in the event that child
29772977
// transactions are later received (resulting in
29782978
// parent-fetching by txid via the orphan-handling logic).
2979-
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && porphanTx->GetWitnessHash() != porphanTx->GetHash()) {
2979+
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && porphanTx->HasWitness()) {
29802980
// We only add the txid if it differs from the wtxid, to
29812981
// avoid wasting entries in the rolling bloom filter.
29822982
m_recent_rejects.insert(porphanTx->GetHash());
@@ -4260,7 +4260,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
42604260
// processing of this transaction in the event that child
42614261
// transactions are later received (resulting in
42624262
// parent-fetching by txid via the orphan-handling logic).
4263-
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && tx.GetWitnessHash() != tx.GetHash()) {
4263+
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && tx.HasWitness()) {
42644264
m_recent_rejects.insert(tx.GetHash());
42654265
m_txrequest.ForgetTxHash(tx.GetHash());
42664266
}

0 commit comments

Comments
 (0)