don't trickle for whitelisted nodes

Rebased-From: fc720207e0
Github-Pull: #5942
This commit is contained in:
Ruben de Vries 2015-03-24 14:29:13 +01:00 committed by Wladimir J. van der Laan
parent a316622fd0
commit 78f64ef0b2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
2 changed files with 7 additions and 2 deletions

View File

@ -179,7 +179,12 @@ bool LoadBlockIndex();
void UnloadBlockIndex(); void UnloadBlockIndex();
/** Process protocol messages received from a given node */ /** Process protocol messages received from a given node */
bool ProcessMessages(CNode* pfrom); bool ProcessMessages(CNode* pfrom);
/** Send queued protocol messages to be sent to a give node */ /**
* Send queued protocol messages to be sent to a give node.
*
* @param[in] pto The node which we are sending messages to.
* @param[in] fSendTrickle When true send the trickled data, otherwise trickle the data until true.
*/
bool SendMessages(CNode* pto, bool fSendTrickle); bool SendMessages(CNode* pto, bool fSendTrickle);
/** Run an instance of the script checking thread */ /** Run an instance of the script checking thread */
void ThreadScriptCheck(); void ThreadScriptCheck();

View File

@ -1456,7 +1456,7 @@ void ThreadMessageHandler()
{ {
TRY_LOCK(pnode->cs_vSend, lockSend); TRY_LOCK(pnode->cs_vSend, lockSend);
if (lockSend) if (lockSend)
g_signals.SendMessages(pnode, pnode == pnodeTrickle); g_signals.SendMessages(pnode, pnode == pnodeTrickle || pnode->fWhitelisted);
} }
boost::this_thread::interruption_point(); boost::this_thread::interruption_point();
} }