Relay txes through MN network faster than through regular nodes (#2397)
* Half the delay for relaying txes to Masternode outbound peers comparing to regular ones * No delay for relaying txes if our node is a Masternode
This commit is contained in:
parent
4a78b161ff
commit
c6cf4d9a47
@ -3343,11 +3343,14 @@ bool SendMessages(CNode* pto, CConnman& connman, const std::atomic<bool>& interr
|
||||
pto->vInventoryBlockToSend.clear();
|
||||
|
||||
// Check whether periodic sends should happen
|
||||
bool fSendTrickle = pto->fWhitelisted;
|
||||
// Note: If this node is running in a Masternode mode, it makes no sense to delay outgoing txes
|
||||
// because we never produce any txes ourselves i.e. no privacy is lost in this case.
|
||||
bool fSendTrickle = pto->fWhitelisted || fMasternodeMode;
|
||||
if (pto->nNextInvSend < nNow) {
|
||||
fSendTrickle = true;
|
||||
// Use half the delay for outbound peers, as there is less privacy concern for them.
|
||||
pto->nNextInvSend = PoissonNextSend(nNow, INVENTORY_BROADCAST_INTERVAL >> !pto->fInbound);
|
||||
// Use half the delay for regular outbound peers, as there is less privacy concern for them,
|
||||
// and quarter the delay for Masternode outbound peers, as there is even less privacy concern in this case.
|
||||
pto->nNextInvSend = PoissonNextSend(nNow, INVENTORY_BROADCAST_INTERVAL >> !pto->fInbound >> pto->fMasternode);
|
||||
}
|
||||
|
||||
// Time to send but the peer has requested we not relay transactions.
|
||||
|
@ -112,7 +112,8 @@ static const unsigned int AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL = 24 * 24 * 60;
|
||||
/** Average delay between peer address broadcasts in seconds. */
|
||||
static const unsigned int AVG_ADDRESS_BROADCAST_INTERVAL = 30;
|
||||
/** Average delay between trickled inventory transmissions in seconds.
|
||||
* Blocks and whitelisted receivers bypass this, outbound peers get half this delay. */
|
||||
* Blocks and whitelisted receivers bypass this, regular outbound peers get half this delay,
|
||||
* Masternode outbound peers get quarter this delay. */
|
||||
static const unsigned int INVENTORY_BROADCAST_INTERVAL = 5;
|
||||
/** Maximum number of inventory items to send per transmission.
|
||||
* Limits the impact of low-fee transaction floods.
|
||||
|
Loading…
Reference in New Issue
Block a user