0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

refactor: add OrphanTxBase for external use

Enables external entities to obtain orphan
information
This commit is contained in:
tdb3 2024-09-05 21:40:52 -04:00
parent fc642c33ef
commit 91b65adff2
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -33,7 +33,7 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
return false;
}
auto ret = m_orphans.emplace(wtxid, OrphanTx{tx, peer, Now<NodeSeconds>() + ORPHAN_TX_EXPIRE_TIME, m_orphan_list.size()});
auto ret = m_orphans.emplace(wtxid, OrphanTx{{tx, peer, Now<NodeSeconds>() + ORPHAN_TX_EXPIRE_TIME}, m_orphan_list.size()});
assert(ret.second);
m_orphan_list.push_back(ret.first);
for (const CTxIn& txin : tx->vin) {

View file

@ -72,11 +72,15 @@ public:
return m_orphans.size();
}
protected:
struct OrphanTx {
/** Allows providing orphan information externally */
struct OrphanTxBase {
CTransactionRef tx;
NodeId fromPeer;
NodeSeconds nTimeExpire;
};
protected:
struct OrphanTx : public OrphanTxBase {
size_t list_pos;
};