From f8c0688b9490c8d4902530ba3c3b6fbd8b48e0de Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Mon, 15 Feb 2021 22:53:06 +1000 Subject: scripted-diff: Update txorphanage naming convention -BEGIN VERIFY SCRIPT- sed -i 's/mapOrphanTransactionsByPrev/m_outpoint_to_orphan_it/g' src/txorphanage.h src/txorphanage.cpp sed -i 's/mapOrphanTransactions/m_orphans/g' src/txorphanage.h src/txorphanage.cpp src/net_processing.cpp src/test/denialofservice_tests.cpp sed -i 's/g_orphan_list/m_orphan_list/g' src/txorphanage.h src/txorphanage.cpp sed -i 's/g_orphans_by_wtxid/m_wtxid_to_orphan_it/g' src/txorphanage.h src/txorphanage.cpp sed -i 's/nMaxOrphans/max_orphans/g' src/txorphanage.h src/txorphanage.cpp sed -i 's/COrphanTx/OrphanTx/g' src/txorphanage.h src/txorphanage.cpp src/test/denialofservice_tests.cpp -END VERIFY SCRIPT- --- src/txorphanage.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/txorphanage.h') diff --git a/src/txorphanage.h b/src/txorphanage.h index 6b9837815b..a5e6764d75 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -36,14 +36,14 @@ public: void EraseForBlock(const CBlock& block) EXCLUSIVE_LOCKS_REQUIRED(!g_cs_orphans); /** Limit the orphanage to the given maximum */ - unsigned int LimitOrphans(unsigned int nMaxOrphans) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); + unsigned int LimitOrphans(unsigned int max_orphans) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); /** Add any orphans that list a particular tx as a parent into a peer's work set * (ie orphans that may have found their final missing parent, and so should be reconsidered for the mempool) */ void AddChildrenToWorkSet(const CTransaction& tx, std::set& orphan_work_set) const EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); protected: - struct COrphanTx { + struct OrphanTx { CTransactionRef tx; NodeId fromPeer; int64_t nTimeExpire; @@ -52,9 +52,9 @@ protected: /** Map from txid to orphan transaction record. Limited by * -maxorphantx/DEFAULT_MAX_ORPHAN_TRANSACTIONS */ - std::map mapOrphanTransactions GUARDED_BY(g_cs_orphans); + std::map m_orphans GUARDED_BY(g_cs_orphans); - using OrphanMap = decltype(mapOrphanTransactions); + using OrphanMap = decltype(m_orphans); struct IteratorComparator { @@ -65,16 +65,16 @@ protected: } }; - /** Index from the parents' COutPoint into the mapOrphanTransactions. Used - * to remove orphan transactions from the mapOrphanTransactions */ - std::map> mapOrphanTransactionsByPrev GUARDED_BY(g_cs_orphans); + /** Index from the parents' COutPoint into the m_orphans. Used + * to remove orphan transactions from the m_orphans */ + std::map> m_outpoint_to_orphan_it GUARDED_BY(g_cs_orphans); /** Orphan transactions in vector for quick random eviction */ - std::vector g_orphan_list GUARDED_BY(g_cs_orphans); + std::vector m_orphan_list GUARDED_BY(g_cs_orphans); - /** Index from wtxid into the mapOrphanTransactions to lookup orphan + /** Index from wtxid into the m_orphans to lookup orphan * transactions using their witness ids. */ - std::map g_orphans_by_wtxid GUARDED_BY(g_cs_orphans); + std::map m_wtxid_to_orphan_it GUARDED_BY(g_cs_orphans); }; #endif // BITCOIN_TXORPHANAGE_H -- cgit v1.2.3