mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-12 07:39:41 +02:00
net_processing: move AddToCompactExtraTransactions into PeerManagerImpl
Allows making vExtraTxnForCompact and vExtraTxnForCompactIt member vars instead of globals.
This commit is contained in:
@@ -459,19 +459,21 @@ private:
|
|||||||
|
|
||||||
/** Storage for orphan information */
|
/** Storage for orphan information */
|
||||||
TxOrphanage m_orphanage;
|
TxOrphanage m_orphanage;
|
||||||
|
|
||||||
|
void AddToCompactExtraTransactions(const CTransactionRef& tx) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans);
|
||||||
|
|
||||||
|
/** Orphan/conflicted/etc transactions that are kept for compact block reconstruction.
|
||||||
|
* The last -blockreconstructionextratxn/DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN of
|
||||||
|
* these are kept in a ring buffer */
|
||||||
|
std::vector<std::pair<uint256, CTransactionRef>> vExtraTxnForCompact GUARDED_BY(g_cs_orphans);
|
||||||
|
/** Offset into vExtraTxnForCompact to insert the next tx */
|
||||||
|
size_t vExtraTxnForCompactIt GUARDED_BY(g_cs_orphans) = 0;
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
/** Number of preferable block download peers. */
|
/** Number of preferable block download peers. */
|
||||||
int nPreferredDownload GUARDED_BY(cs_main) = 0;
|
int nPreferredDownload GUARDED_BY(cs_main) = 0;
|
||||||
|
|
||||||
/** Orphan/conflicted/etc transactions that are kept for compact block reconstruction.
|
|
||||||
* The last -blockreconstructionextratxn/DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN of
|
|
||||||
* these are kept in a ring buffer */
|
|
||||||
static std::vector<std::pair<uint256, CTransactionRef>> vExtraTxnForCompact GUARDED_BY(g_cs_orphans);
|
|
||||||
/** Offset into vExtraTxnForCompact to insert the next tx */
|
|
||||||
static size_t vExtraTxnForCompactIt GUARDED_BY(g_cs_orphans) = 0;
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -1081,7 +1083,7 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AddToCompactExtraTransactions(const CTransactionRef& tx) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)
|
void PeerManagerImpl::AddToCompactExtraTransactions(const CTransactionRef& tx)
|
||||||
{
|
{
|
||||||
size_t max_extra_txn = gArgs.GetArg("-blockreconstructionextratxn", DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN);
|
size_t max_extra_txn = gArgs.GetArg("-blockreconstructionextratxn", DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN);
|
||||||
if (max_extra_txn <= 0)
|
if (max_extra_txn <= 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user