diff options
author | Anthony Towns <aj@erisian.com.au> | 2021-01-31 21:24:08 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2021-02-26 23:55:10 +1000 |
commit | 83679ffc600305ec0926fd195ee31c11de2ed613 (patch) | |
tree | 174fe9757d0aaf5354acf0d6eba68cbe3b9e79dd /src/txorphanage.cpp | |
parent | ee135c8d5b39b0cb8b301a83e286285ab926dca7 (diff) |
txorphanage: Extract HaveOrphanTx
Extract some common code into HaveOrphanTx function.
Diffstat (limited to 'src/txorphanage.cpp')
-rw-r--r-- | src/txorphanage.cpp | 10 |
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()); + } +} + |