aboutsummaryrefslogtreecommitdiff
path: root/src/txorphanage.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-01-31 21:24:08 +1000
committerAnthony Towns <aj@erisian.com.au>2021-02-26 23:55:10 +1000
commit83679ffc600305ec0926fd195ee31c11de2ed613 (patch)
tree174fe9757d0aaf5354acf0d6eba68cbe3b9e79dd /src/txorphanage.cpp
parentee135c8d5b39b0cb8b301a83e286285ab926dca7 (diff)
txorphanage: Extract HaveOrphanTx
Extract some common code into HaveOrphanTx function.
Diffstat (limited to 'src/txorphanage.cpp')
-rw-r--r--src/txorphanage.cpp10
1 files changed, 10 insertions, 0 deletions
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<uint256>& 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());
+ }
+}
+