Access fRelayTxes with cs_filter lock in copyStats

zcash: cherry picked from commit 512731bed0782f10092de35a960153b17ecc11eb
zcash: https://github.com/bitcoin/bitcoin/pull/9708
This commit is contained in:
Matt Corallo 2017-02-06 11:53:34 -05:00 committed by Jack Grigg
parent 5d3586f707
commit c2c43e39b2
1 changed files with 4 additions and 1 deletions

View File

@ -641,7 +641,10 @@ void CNode::copyStats(CNodeStats &stats)
{
stats.nodeid = this->GetId();
stats.nServices = nServices;
stats.fRelayTxes = fRelayTxes;
{
LOCK(cs_filter);
stats.fRelayTxes = fRelayTxes;
}
stats.nLastSend = nLastSend;
stats.nLastRecv = nLastRecv;
stats.nTimeConnected = nTimeConnected;