Skip to content

Commit 5572f98

Browse files
committed
Merge bitcoin/bitcoin#28107: util: Type-safe transaction identifiers
940a499 Use type-safe txid types in orphanage (dergoegge) ed70e65 Introduce types for txids & wtxids (dergoegge) cdb14d7 [net processing] Use HasWitness over comparing (w)txids (dergoegge) Pull request description: We currently have two different identifiers for transactions: `txid` (refering to the hash of a transaction without witness data) and `wtxid` (referring to the hash of a transaction including witness data). Both are typed as `uint256` which could lead to type-safety bugs in which one transaction identifier type is passed where the other would be expected. This PR introduces explicit `Txid` and `Wtxid` types that (if used) would cause compilation errors for such type confusion bugs. (Only the orphanage is converted to use these types in this PR) ACKs for top commit: achow101: ACK 940a499 stickies-v: ACK 940a499 hebasto: ACK 940a499, I have reviewed the code and it looks OK. instagibbs: re-ACK 940a499 BrandonOdiwuor: re-ACK 940a499 glozow: reACK 940a499 Tree-SHA512: 55298d1c2bb82b7a6995e96e554571c22eaf4a89fb2a4d7a236d70e0f625e8cca62ff2490e1c179c47bd93153fe6527b56870198f026f5ee7753d64d7a424c92
2 parents cb8844e + 940a499 commit 5572f98

File tree

12 files changed

+139
-61
lines changed

12 files changed

+139
-61
lines changed

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ BITCOIN_CORE_H = \
328328
util/time.h \
329329
util/tokenpipe.h \
330330
util/trace.h \
331+
util/transaction_identifier.h \
331332
util/translation.h \
332333
util/types.h \
333334
util/ui_change_type.h \

src/net_processing.cpp

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,9 +1947,9 @@ void PeerManagerImpl::BlockConnected(
19471947
{
19481948
LOCK(m_recent_confirmed_transactions_mutex);
19491949
for (const auto& ptx : pblock->vtx) {
1950-
m_recent_confirmed_transactions.insert(ptx->GetHash());
1951-
if (ptx->GetHash() != ptx->GetWitnessHash()) {
1952-
m_recent_confirmed_transactions.insert(ptx->GetWitnessHash());
1950+
m_recent_confirmed_transactions.insert(ptx->GetHash().ToUint256());
1951+
if (ptx->HasWitness()) {
1952+
m_recent_confirmed_transactions.insert(ptx->GetWitnessHash().ToUint256());
19531953
}
19541954
}
19551955
}
@@ -3003,8 +3003,8 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
30033003
while (CTransactionRef porphanTx = m_orphanage.GetTxToReconsider(peer.m_id)) {
30043004
const MempoolAcceptResult result = m_chainman.ProcessTransaction(porphanTx);
30053005
const TxValidationState& state = result.m_state;
3006-
const uint256& orphanHash = porphanTx->GetHash();
3007-
const uint256& orphan_wtxid = porphanTx->GetWitnessHash();
3006+
const Txid& orphanHash = porphanTx->GetHash();
3007+
const Wtxid& orphan_wtxid = porphanTx->GetWitnessHash();
30083008

30093009
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
30103010
LogPrint(BCLog::TXPACKAGES, " accepted orphan tx %s (wtxid=%s)\n", orphanHash.ToString(), orphan_wtxid.ToString());
@@ -3052,7 +3052,7 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
30523052
// See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
30533053
// for concerns around weakening security of unupgraded nodes
30543054
// if we start doing this too early.
3055-
m_recent_rejects.insert(porphanTx->GetWitnessHash());
3055+
m_recent_rejects.insert(porphanTx->GetWitnessHash().ToUint256());
30563056
// If the transaction failed for TX_INPUTS_NOT_STANDARD,
30573057
// then we know that the witness was irrelevant to the policy
30583058
// failure, since this check depends only on the txid
@@ -3061,10 +3061,10 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
30613061
// processing of this transaction in the event that child
30623062
// transactions are later received (resulting in
30633063
// parent-fetching by txid via the orphan-handling logic).
3064-
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && porphanTx->GetWitnessHash() != porphanTx->GetHash()) {
3064+
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && porphanTx->HasWitness()) {
30653065
// We only add the txid if it differs from the wtxid, to
30663066
// avoid wasting entries in the rolling bloom filter.
3067-
m_recent_rejects.insert(porphanTx->GetHash());
3067+
m_recent_rejects.insert(porphanTx->GetHash().ToUint256());
30683068
}
30693069
}
30703070
m_orphanage.EraseTx(orphanHash);
@@ -4319,8 +4319,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
43194319
// regardless of what witness is provided, we will not accept
43204320
// this, so we don't need to allow for redownload of this txid
43214321
// from any of our non-wtxidrelay peers.
4322-
m_recent_rejects.insert(tx.GetHash());
4323-
m_recent_rejects.insert(tx.GetWitnessHash());
4322+
m_recent_rejects.insert(tx.GetHash().ToUint256());
4323+
m_recent_rejects.insert(tx.GetWitnessHash().ToUint256());
43244324
m_txrequest.ForgetTxHash(tx.GetHash());
43254325
m_txrequest.ForgetTxHash(tx.GetWitnessHash());
43264326
}
@@ -4339,7 +4339,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
43394339
// See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
43404340
// for concerns around weakening security of unupgraded nodes
43414341
// if we start doing this too early.
4342-
m_recent_rejects.insert(tx.GetWitnessHash());
4342+
m_recent_rejects.insert(tx.GetWitnessHash().ToUint256());
43434343
m_txrequest.ForgetTxHash(tx.GetWitnessHash());
43444344
// If the transaction failed for TX_INPUTS_NOT_STANDARD,
43454345
// then we know that the witness was irrelevant to the policy
@@ -4349,8 +4349,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
43494349
// processing of this transaction in the event that child
43504350
// transactions are later received (resulting in
43514351
// parent-fetching by txid via the orphan-handling logic).
4352-
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && tx.GetWitnessHash() != tx.GetHash()) {
4353-
m_recent_rejects.insert(tx.GetHash());
4352+
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && tx.HasWitness()) {
4353+
m_recent_rejects.insert(tx.GetHash().ToUint256());
43544354
m_txrequest.ForgetTxHash(tx.GetHash());
43554355
}
43564356
if (RecursiveDynamicUsage(*ptx) < 100000) {
@@ -5780,17 +5780,22 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
57805780
LOCK(tx_relay->m_bloom_filter_mutex);
57815781

57825782
for (const auto& txinfo : vtxinfo) {
5783-
const uint256& hash = peer->m_wtxid_relay ? txinfo.tx->GetWitnessHash() : txinfo.tx->GetHash();
5784-
CInv inv(peer->m_wtxid_relay ? MSG_WTX : MSG_TX, hash);
5785-
tx_relay->m_tx_inventory_to_send.erase(hash);
5783+
CInv inv{
5784+
peer->m_wtxid_relay ? MSG_WTX : MSG_TX,
5785+
peer->m_wtxid_relay ?
5786+
txinfo.tx->GetWitnessHash().ToUint256() :
5787+
txinfo.tx->GetHash().ToUint256(),
5788+
};
5789+
tx_relay->m_tx_inventory_to_send.erase(inv.hash);
5790+
57865791
// Don't send transactions that peers will not put into their mempool
57875792
if (txinfo.fee < filterrate.GetFee(txinfo.vsize)) {
57885793
continue;
57895794
}
57905795
if (tx_relay->m_bloom_filter) {
57915796
if (!tx_relay->m_bloom_filter->IsRelevantAndUpdate(*txinfo.tx)) continue;
57925797
}
5793-
tx_relay->m_tx_inventory_known_filter.insert(hash);
5798+
tx_relay->m_tx_inventory_known_filter.insert(inv.hash);
57945799
vInv.push_back(inv);
57955800
if (vInv.size() == MAX_INV_SZ) {
57965801
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));

src/primitives/transaction.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <tinyformat.h>
1313
#include <uint256.h>
1414
#include <util/strencodings.h>
15+
#include <util/transaction_identifier.h>
1516
#include <version.h>
1617

1718
#include <cassert>
@@ -65,22 +66,23 @@ std::string CTxOut::ToString() const
6566
CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {}
6667
CMutableTransaction::CMutableTransaction(const CTransaction& tx) : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion), nLockTime(tx.nLockTime) {}
6768

68-
uint256 CMutableTransaction::GetHash() const
69+
Txid CMutableTransaction::GetHash() const
6970
{
70-
return (CHashWriter{SERIALIZE_TRANSACTION_NO_WITNESS} << *this).GetHash();
71+
return Txid::FromUint256((CHashWriter{SERIALIZE_TRANSACTION_NO_WITNESS} << *this).GetHash());
7172
}
7273

73-
uint256 CTransaction::ComputeHash() const
74+
Txid CTransaction::ComputeHash() const
7475
{
75-
return (CHashWriter{SERIALIZE_TRANSACTION_NO_WITNESS} << *this).GetHash();
76+
return Txid::FromUint256((CHashWriter{SERIALIZE_TRANSACTION_NO_WITNESS} << *this).GetHash());
7677
}
7778

78-
uint256 CTransaction::ComputeWitnessHash() const
79+
Wtxid CTransaction::ComputeWitnessHash() const
7980
{
8081
if (!HasWitness()) {
81-
return hash;
82+
return Wtxid::FromUint256(hash.ToUint256());
8283
}
83-
return (CHashWriter{0} << *this).GetHash();
84+
85+
return Wtxid::FromUint256((CHashWriter{0} << *this).GetHash());
8486
}
8587

8688
CTransaction::CTransaction(const CMutableTransaction& tx) : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion), nLockTime(tx.nLockTime), hash{ComputeHash()}, m_witness_hash{ComputeWitnessHash()} {}

src/primitives/transaction.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <script/script.h>
1212
#include <serialize.h>
1313
#include <uint256.h>
14+
#include <util/transaction_identifier.h> // IWYU pragma: export
1415

1516
#include <cstddef>
1617
#include <cstdint>
@@ -309,11 +310,11 @@ class CTransaction
309310

310311
private:
311312
/** Memory only. */
312-
const uint256 hash;
313-
const uint256 m_witness_hash;
313+
const Txid hash;
314+
const Wtxid m_witness_hash;
314315

315-
uint256 ComputeHash() const;
316-
uint256 ComputeWitnessHash() const;
316+
Txid ComputeHash() const;
317+
Wtxid ComputeWitnessHash() const;
317318

318319
public:
319320
/** Convert a CMutableTransaction into a CTransaction. */
@@ -334,8 +335,8 @@ class CTransaction
334335
return vin.empty() && vout.empty();
335336
}
336337

337-
const uint256& GetHash() const { return hash; }
338-
const uint256& GetWitnessHash() const { return m_witness_hash; };
338+
const Txid& GetHash() const { return hash; }
339+
const Wtxid& GetWitnessHash() const { return m_witness_hash; };
339340

340341
// Return sum of txouts.
341342
CAmount GetValueOut() const;
@@ -405,7 +406,7 @@ struct CMutableTransaction
405406
/** Compute the hash of this CMutableTransaction. This is computed on the
406407
* fly, as opposed to GetHash() in CTransaction, which uses a cached result.
407408
*/
408-
uint256 GetHash() const;
409+
Txid GetHash() const;
409410

410411
bool HasWitness() const
411412
{

src/test/fuzz/package_eval.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ FUZZ_TARGET(tx_package_eval, .init = initialize_tx_pool)
238238
}
239239
if (fuzzed_data_provider.ConsumeBool()) {
240240
const auto& txid = fuzzed_data_provider.ConsumeBool() ?
241-
txs.back()->GetHash() :
241+
txs.back()->GetHash().ToUint256() :
242242
PickValue(fuzzed_data_provider, mempool_outpoints).hash;
243243
const auto delta = fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(-50 * COIN, +50 * COIN);
244244
tx_pool.PrioritiseTransaction(txid, delta);

src/test/fuzz/tx_pool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
227227
}
228228
if (fuzzed_data_provider.ConsumeBool()) {
229229
const auto& txid = fuzzed_data_provider.ConsumeBool() ?
230-
tx->GetHash() :
230+
tx->GetHash().ToUint256() :
231231
PickValue(fuzzed_data_provider, outpoints_rbf).hash;
232232
const auto delta = fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(-50 * COIN, +50 * COIN);
233233
tx_pool.PrioritiseTransaction(txid, delta);
@@ -344,7 +344,7 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool)
344344
}
345345
if (fuzzed_data_provider.ConsumeBool()) {
346346
const auto& txid = fuzzed_data_provider.ConsumeBool() ?
347-
mut_tx.GetHash() :
347+
mut_tx.GetHash().ToUint256() :
348348
PickValue(fuzzed_data_provider, txids);
349349
const auto delta = fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(-50 * COIN, +50 * COIN);
350350
tx_pool.PrioritiseTransaction(txid, delta);

src/test/orphanage_tests.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <arith_uint256.h>
6+
#include <primitives/transaction.h>
67
#include <pubkey.h>
78
#include <script/sign.h>
89
#include <script/signingprovider.h>
@@ -29,8 +30,8 @@ class TxOrphanageTest : public TxOrphanage
2930
CTransactionRef RandomOrphan() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
3031
{
3132
LOCK(m_mutex);
32-
std::map<uint256, OrphanTx>::iterator it;
33-
it = m_orphans.lower_bound(InsecureRand256());
33+
std::map<Txid, OrphanTx>::iterator it;
34+
it = m_orphans.lower_bound(Txid::FromUint256(InsecureRand256()));
3435
if (it == m_orphans.end())
3536
it = m_orphans.begin();
3637
return it->second.tx;

src/txorphanage.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <consensus/validation.h>
88
#include <logging.h>
99
#include <policy/policy.h>
10+
#include <primitives/transaction.h>
1011

1112
#include <cassert>
1213

@@ -20,8 +21,8 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
2021
{
2122
LOCK(m_mutex);
2223

23-
const uint256& hash = tx->GetHash();
24-
const uint256& wtxid = tx->GetWitnessHash();
24+
const Txid& hash = tx->GetHash();
25+
const Wtxid& wtxid = tx->GetWitnessHash();
2526
if (m_orphans.count(hash))
2627
return false;
2728

@@ -53,16 +54,16 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
5354
return true;
5455
}
5556

56-
int TxOrphanage::EraseTx(const uint256& txid)
57+
int TxOrphanage::EraseTx(const Txid& txid)
5758
{
5859
LOCK(m_mutex);
5960
return EraseTxNoLock(txid);
6061
}
6162

62-
int TxOrphanage::EraseTxNoLock(const uint256& txid)
63+
int TxOrphanage::EraseTxNoLock(const Txid& txid)
6364
{
6465
AssertLockHeld(m_mutex);
65-
std::map<uint256, OrphanTx>::iterator it = m_orphans.find(txid);
66+
std::map<Txid, OrphanTx>::iterator it = m_orphans.find(txid);
6667
if (it == m_orphans.end())
6768
return 0;
6869
for (const CTxIn& txin : it->second.tx->vin)
@@ -100,10 +101,10 @@ void TxOrphanage::EraseForPeer(NodeId peer)
100101
m_peer_work_set.erase(peer);
101102

102103
int nErased = 0;
103-
std::map<uint256, OrphanTx>::iterator iter = m_orphans.begin();
104+
std::map<Txid, OrphanTx>::iterator iter = m_orphans.begin();
104105
while (iter != m_orphans.end())
105106
{
106-
std::map<uint256, OrphanTx>::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid
107+
std::map<Txid, OrphanTx>::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid
107108
if (maybeErase->second.fromPeer == peer)
108109
{
109110
nErased += EraseTxNoLock(maybeErase->second.tx->GetHash());
@@ -123,10 +124,10 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans)
123124
// Sweep out expired orphan pool entries:
124125
int nErased = 0;
125126
int64_t nMinExpTime = nNow + ORPHAN_TX_EXPIRE_TIME - ORPHAN_TX_EXPIRE_INTERVAL;
126-
std::map<uint256, OrphanTx>::iterator iter = m_orphans.begin();
127+
std::map<Txid, OrphanTx>::iterator iter = m_orphans.begin();
127128
while (iter != m_orphans.end())
128129
{
129-
std::map<uint256, OrphanTx>::iterator maybeErase = iter++;
130+
std::map<Txid, OrphanTx>::iterator maybeErase = iter++;
130131
if (maybeErase->second.nTimeExpire <= nNow) {
131132
nErased += EraseTxNoLock(maybeErase->second.tx->GetHash());
132133
} else {
@@ -159,7 +160,7 @@ void TxOrphanage::AddChildrenToWorkSet(const CTransaction& tx)
159160
for (const auto& elem : it_by_prev->second) {
160161
// Get this source peer's work set, emplacing an empty set if it didn't exist
161162
// (note: if this peer wasn't still connected, we would have removed the orphan tx already)
162-
std::set<uint256>& orphan_work_set = m_peer_work_set.try_emplace(elem->second.fromPeer).first->second;
163+
std::set<Txid>& orphan_work_set = m_peer_work_set.try_emplace(elem->second.fromPeer).first->second;
163164
// Add this tx to the work set
164165
orphan_work_set.insert(elem->first);
165166
LogPrint(BCLog::TXPACKAGES, "added %s (wtxid=%s) to peer %d workset\n",
@@ -173,9 +174,9 @@ bool TxOrphanage::HaveTx(const GenTxid& gtxid) const
173174
{
174175
LOCK(m_mutex);
175176
if (gtxid.IsWtxid()) {
176-
return m_wtxid_to_orphan_it.count(gtxid.GetHash());
177+
return m_wtxid_to_orphan_it.count(Wtxid::FromUint256(gtxid.GetHash()));
177178
} else {
178-
return m_orphans.count(gtxid.GetHash());
179+
return m_orphans.count(Txid::FromUint256(gtxid.GetHash()));
179180
}
180181
}
181182

@@ -187,7 +188,7 @@ CTransactionRef TxOrphanage::GetTxToReconsider(NodeId peer)
187188
if (work_set_it != m_peer_work_set.end()) {
188189
auto& work_set = work_set_it->second;
189190
while (!work_set.empty()) {
190-
uint256 txid = *work_set.begin();
191+
Txid txid = *work_set.begin();
191192
work_set.erase(work_set.begin());
192193

193194
const auto orphan_it = m_orphans.find(txid);
@@ -215,7 +216,7 @@ void TxOrphanage::EraseForBlock(const CBlock& block)
215216
{
216217
LOCK(m_mutex);
217218

218-
std::vector<uint256> vOrphanErase;
219+
std::vector<Txid> vOrphanErase;
219220

220221
for (const CTransactionRef& ptx : block.vtx) {
221222
const CTransaction& tx = *ptx;
@@ -226,7 +227,7 @@ void TxOrphanage::EraseForBlock(const CBlock& block)
226227
if (itByPrev == m_outpoint_to_orphan_it.end()) continue;
227228
for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
228229
const CTransaction& orphanTx = *(*mi)->second.tx;
229-
const uint256& orphanHash = orphanTx.GetHash();
230+
const auto& orphanHash = orphanTx.GetHash();
230231
vOrphanErase.push_back(orphanHash);
231232
}
232233
}
@@ -235,7 +236,7 @@ void TxOrphanage::EraseForBlock(const CBlock& block)
235236
// Erase orphan transactions included or precluded by this block
236237
if (vOrphanErase.size()) {
237238
int nErased = 0;
238-
for (const uint256& orphanHash : vOrphanErase) {
239+
for (const auto& orphanHash : vOrphanErase) {
239240
nErased += EraseTxNoLock(orphanHash);
240241
}
241242
LogPrint(BCLog::TXPACKAGES, "Erased %d orphan tx included or conflicted by block\n", nErased);

src/txorphanage.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TxOrphanage {
3434
CTransactionRef GetTxToReconsider(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
3535

3636
/** Erase an orphan by txid */
37-
int EraseTx(const uint256& txid) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
37+
int EraseTx(const Txid& txid) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
3838

3939
/** Erase all orphans announced by a peer (eg, after that peer disconnects) */
4040
void EraseForPeer(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
@@ -71,10 +71,10 @@ class TxOrphanage {
7171

7272
/** Map from txid to orphan transaction record. Limited by
7373
* -maxorphantx/DEFAULT_MAX_ORPHAN_TRANSACTIONS */
74-
std::map<uint256, OrphanTx> m_orphans GUARDED_BY(m_mutex);
74+
std::map<Txid, OrphanTx> m_orphans GUARDED_BY(m_mutex);
7575

7676
/** Which peer provided the orphans that need to be reconsidered */
77-
std::map<NodeId, std::set<uint256>> m_peer_work_set GUARDED_BY(m_mutex);
77+
std::map<NodeId, std::set<Txid>> m_peer_work_set GUARDED_BY(m_mutex);
7878

7979
using OrphanMap = decltype(m_orphans);
8080

@@ -96,10 +96,10 @@ class TxOrphanage {
9696

9797
/** Index from wtxid into the m_orphans to lookup orphan
9898
* transactions using their witness ids. */
99-
std::map<uint256, OrphanMap::iterator> m_wtxid_to_orphan_it GUARDED_BY(m_mutex);
99+
std::map<Wtxid, OrphanMap::iterator> m_wtxid_to_orphan_it GUARDED_BY(m_mutex);
100100

101101
/** Erase an orphan by txid */
102-
int EraseTxNoLock(const uint256& txid) EXCLUSIVE_LOCKS_REQUIRED(m_mutex);
102+
int EraseTxNoLock(const Txid& txid) EXCLUSIVE_LOCKS_REQUIRED(m_mutex);
103103
};
104104

105105
#endif // BITCOIN_TXORPHANAGE_H

0 commit comments

Comments
 (0)