From 940a49978c70453e1aaf2c4a0bcb382872b844a5 Mon Sep 17 00:00:00 2001 From: dergoegge Date: Wed, 19 Jul 2023 15:56:37 +0200 Subject: [PATCH] Use type-safe txid types in orphanage --- src/net_processing.cpp | 4 ++-- src/test/orphanage_tests.cpp | 5 +++-- src/txorphanage.cpp | 33 +++++++++++++++++---------------- src/txorphanage.h | 10 +++++----- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 58bf3ec5d1e..6391ecc934c 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2918,8 +2918,8 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer) while (CTransactionRef porphanTx = m_orphanage.GetTxToReconsider(peer.m_id)) { const MempoolAcceptResult result = m_chainman.ProcessTransaction(porphanTx); const TxValidationState& state = result.m_state; - const uint256& orphanHash = porphanTx->GetHash(); - const uint256& orphan_wtxid = porphanTx->GetWitnessHash(); + const Txid& orphanHash = porphanTx->GetHash(); + const Wtxid& orphan_wtxid = porphanTx->GetWitnessHash(); if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) { LogPrint(BCLog::TXPACKAGES, " accepted orphan tx %s (wtxid=%s)\n", orphanHash.ToString(), orphan_wtxid.ToString()); diff --git a/src/test/orphanage_tests.cpp b/src/test/orphanage_tests.cpp index af53737fecb..d374497a45c 100644 --- a/src/test/orphanage_tests.cpp +++ b/src/test/orphanage_tests.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include