Skip to content

Commit 91b65ad

Browse files
committed
refactor: add OrphanTxBase for external use
Enables external entities to obtain orphan information
1 parent fc642c3 commit 91b65ad

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/txorphanage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
3333
return false;
3434
}
3535

36-
auto ret = m_orphans.emplace(wtxid, OrphanTx{tx, peer, Now<NodeSeconds>() + ORPHAN_TX_EXPIRE_TIME, m_orphan_list.size()});
36+
auto ret = m_orphans.emplace(wtxid, OrphanTx{{tx, peer, Now<NodeSeconds>() + ORPHAN_TX_EXPIRE_TIME}, m_orphan_list.size()});
3737
assert(ret.second);
3838
m_orphan_list.push_back(ret.first);
3939
for (const CTxIn& txin : tx->vin) {

src/txorphanage.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ class TxOrphanage {
7272
return m_orphans.size();
7373
}
7474

75-
protected:
76-
struct OrphanTx {
75+
/** Allows providing orphan information externally */
76+
struct OrphanTxBase {
7777
CTransactionRef tx;
7878
NodeId fromPeer;
7979
NodeSeconds nTimeExpire;
80+
};
81+
82+
protected:
83+
struct OrphanTx : public OrphanTxBase {
8084
size_t list_pos;
8185
};
8286

0 commit comments

Comments
 (0)