aboutsummaryrefslogtreecommitdiff
path: root/src/txorphanage.h
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-03-28 17:14:38 +0000
committerglozow <gloriajzhao@gmail.com>2024-04-26 10:28:27 +0100
commit2f51cd680fb4323f1c792dae37d4c4e0e0e35804 (patch)
treee2c3e58a42fdd02acf0ab5ad1e63d64125c71f65 /src/txorphanage.h
parent092c978a42e8f4a02291b994713505ba8aac8b28 (diff)
[txorphanage] add method to get all orphans spending a tx
Diffstat (limited to 'src/txorphanage.h')
-rw-r--r--src/txorphanage.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/txorphanage.h b/src/txorphanage.h
index 2fd14e6fd2..a3c8edaa2a 100644
--- a/src/txorphanage.h
+++ b/src/txorphanage.h
@@ -51,6 +51,14 @@ public:
/** Does this peer have any work to do? */
bool HaveTxToReconsider(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);;
+ /** Get all children that spend from this tx and were received from nodeid. Sorted from most
+ * recent to least recent. */
+ std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
+
+ /** Get all children that spend from this tx but were not received from nodeid. Also return
+ * which peer provided each tx. */
+ std::vector<std::pair<CTransactionRef, NodeId>> GetChildrenFromDifferentPeer(const CTransactionRef& parent, NodeId nodeid) const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
+
/** Return how many entries exist in the orphange */
size_t Size() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
{