From 83679ffc600305ec0926fd195ee31c11de2ed613 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Sun, 31 Jan 2021 21:24:08 +1000 Subject: txorphanage: Extract HaveOrphanTx Extract some common code into HaveOrphanTx function. --- src/txorphanage.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/txorphanage.cpp') diff --git a/src/txorphanage.cpp b/src/txorphanage.cpp index c1443115f0..473abd5044 100644 --- a/src/txorphanage.cpp +++ b/src/txorphanage.cpp @@ -119,3 +119,13 @@ void AddChildrenToWorkSet(const CTransaction& tx, std::set& orphan_work } } +bool HaveOrphanTx(const GenTxid& gtxid) +{ + LOCK(g_cs_orphans); + if (gtxid.IsWtxid()) { + return g_orphans_by_wtxid.count(gtxid.GetHash()); + } else { + return mapOrphanTransactions.count(gtxid.GetHash()); + } +} + -- cgit v1.2.3