@@ -1851,9 +1851,9 @@ void PeerManagerImpl::BlockConnected(const std::shared_ptr<const CBlock>& pblock
18511851 {
18521852 LOCK (m_recent_confirmed_transactions_mutex);
18531853 for (const auto & ptx : pblock->vtx ) {
1854- m_recent_confirmed_transactions.insert (ptx->GetHash ());
1854+ m_recent_confirmed_transactions.insert (ptx->GetHash (). ToUint256 () );
18551855 if (ptx->HasWitness ()) {
1856- m_recent_confirmed_transactions.insert (ptx->GetWitnessHash ());
1856+ m_recent_confirmed_transactions.insert (ptx->GetWitnessHash (). ToUint256 () );
18571857 }
18581858 }
18591859 }
@@ -2967,7 +2967,7 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
29672967 // See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
29682968 // for concerns around weakening security of unupgraded nodes
29692969 // if we start doing this too early.
2970- m_recent_rejects.insert (porphanTx->GetWitnessHash ());
2970+ m_recent_rejects.insert (porphanTx->GetWitnessHash (). ToUint256 () );
29712971 // If the transaction failed for TX_INPUTS_NOT_STANDARD,
29722972 // then we know that the witness was irrelevant to the policy
29732973 // failure, since this check depends only on the txid
@@ -2979,7 +2979,7 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
29792979 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.
2982- m_recent_rejects.insert (porphanTx->GetHash ());
2982+ m_recent_rejects.insert (porphanTx->GetHash (). ToUint256 () );
29832983 }
29842984 }
29852985 m_orphanage.EraseTx (orphanHash);
@@ -4230,8 +4230,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
42304230 // regardless of what witness is provided, we will not accept
42314231 // this, so we don't need to allow for redownload of this txid
42324232 // from any of our non-wtxidrelay peers.
4233- m_recent_rejects.insert (tx.GetHash ());
4234- m_recent_rejects.insert (tx.GetWitnessHash ());
4233+ m_recent_rejects.insert (tx.GetHash (). ToUint256 () );
4234+ m_recent_rejects.insert (tx.GetWitnessHash (). ToUint256 () );
42354235 m_txrequest.ForgetTxHash (tx.GetHash ());
42364236 m_txrequest.ForgetTxHash (tx.GetWitnessHash ());
42374237 }
@@ -4250,7 +4250,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
42504250 // See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
42514251 // for concerns around weakening security of unupgraded nodes
42524252 // if we start doing this too early.
4253- m_recent_rejects.insert (tx.GetWitnessHash ());
4253+ m_recent_rejects.insert (tx.GetWitnessHash (). ToUint256 () );
42544254 m_txrequest.ForgetTxHash (tx.GetWitnessHash ());
42554255 // If the transaction failed for TX_INPUTS_NOT_STANDARD,
42564256 // then we know that the witness was irrelevant to the policy
@@ -4261,7 +4261,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
42614261 // transactions are later received (resulting in
42624262 // parent-fetching by txid via the orphan-handling logic).
42634263 if (state.GetResult () == TxValidationResult::TX_INPUTS_NOT_STANDARD && tx.HasWitness ()) {
4264- m_recent_rejects.insert (tx.GetHash ());
4264+ m_recent_rejects.insert (tx.GetHash (). ToUint256 () );
42654265 m_txrequest.ForgetTxHash (tx.GetHash ());
42664266 }
42674267 if (RecursiveDynamicUsage (*ptx) < 100000 ) {
@@ -5694,17 +5694,22 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
56945694 LOCK (tx_relay->m_bloom_filter_mutex );
56955695
56965696 for (const auto & txinfo : vtxinfo) {
5697- const uint256& hash = peer->m_wtxid_relay ? txinfo.tx ->GetWitnessHash () : txinfo.tx ->GetHash ();
5698- CInv inv (peer->m_wtxid_relay ? MSG_WTX : MSG_TX, hash);
5699- tx_relay->m_tx_inventory_to_send .erase (hash);
5697+ CInv inv{
5698+ peer->m_wtxid_relay ? MSG_WTX : MSG_TX,
5699+ peer->m_wtxid_relay ?
5700+ txinfo.tx ->GetWitnessHash ().ToUint256 () :
5701+ txinfo.tx ->GetHash ().ToUint256 (),
5702+ };
5703+ tx_relay->m_tx_inventory_to_send .erase (inv.hash );
5704+
57005705 // Don't send transactions that peers will not put into their mempool
57015706 if (txinfo.fee < filterrate.GetFee (txinfo.vsize )) {
57025707 continue ;
57035708 }
57045709 if (tx_relay->m_bloom_filter ) {
57055710 if (!tx_relay->m_bloom_filter ->IsRelevantAndUpdate (*txinfo.tx )) continue ;
57065711 }
5707- tx_relay->m_tx_inventory_known_filter .insert (hash);
5712+ tx_relay->m_tx_inventory_known_filter .insert (inv. hash );
57085713 vInv.push_back (inv);
57095714 if (vInv.size () == MAX_INV_SZ) {
57105715 m_connman.PushMessage (pto, msgMaker.Make (NetMsgType::INV, vInv));
0 commit comments