diff --git a/src/txorphanage.cpp b/src/txorphanage.cpp index 35a215c88a4..35cf26a7be1 100644 --- a/src/txorphanage.cpp +++ b/src/txorphanage.cpp @@ -33,7 +33,7 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer) return false; } - auto ret = m_orphans.emplace(wtxid, OrphanTx{tx, peer, Now() + ORPHAN_TX_EXPIRE_TIME, m_orphan_list.size()}); + auto ret = m_orphans.emplace(wtxid, OrphanTx{{tx, peer, Now() + ORPHAN_TX_EXPIRE_TIME}, m_orphan_list.size()}); assert(ret.second); m_orphan_list.push_back(ret.first); for (const CTxIn& txin : tx->vin) { diff --git a/src/txorphanage.h b/src/txorphanage.h index 2c53d1d40f6..5123bfe8678 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -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; };