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:
parent
fc642c33ef
commit
91b65adff2
2 changed files with 7 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue