mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 137a98c5a2 into merged_master (Bitcoin PR bitcoin/bitcoin#27610)
This commit is contained in:
commit
974c4bd0b9
2 changed files with 11 additions and 4 deletions
|
|
@ -5746,7 +5746,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||
// especially since we have many peers and some will draw much shorter delays.
|
||||
unsigned int nRelayedTransactions = 0;
|
||||
LOCK(tx_relay->m_bloom_filter_mutex);
|
||||
while (!vInvTx.empty() && nRelayedTransactions < INVENTORY_BROADCAST_MAX) {
|
||||
size_t broadcast_max{INVENTORY_BROADCAST_MAX + (tx_relay->m_tx_inventory_to_send.size()/1000)*5};
|
||||
broadcast_max = std::min<size_t>(1000, broadcast_max);
|
||||
while (!vInvTx.empty() && nRelayedTransactions < broadcast_max) {
|
||||
// Fetch the top element from the heap
|
||||
std::pop_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder);
|
||||
std::set<uint256>::iterator it = vInvTx.back();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue