Skip to content

Commit

Permalink
Relay spork after updating internal spork maps (#2777)
Browse files Browse the repository at this point in the history
Otherwise regtest nodes might end up sending "getdata" too fast, which
results in the spork not being propagated.
  • Loading branch information
codablock committed Mar 18, 2019
1 parent e52763d commit a5d2edb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ bool CSporkManager::UpdateSpork(int nSporkID, int64_t nValue, CConnman& connman)
LogPrintf("CSporkManager::UpdateSpork: failed to find keyid for private key\n");
return false;
}
{
LOCK(cs);
mapSporksByHash[spork.GetHash()] = spork;
mapSporksActive[nSporkID][keyIDSigner] = spork;
}
spork.Relay(connman);
LOCK(cs);
mapSporksByHash[spork.GetHash()] = spork;
mapSporksActive[nSporkID][keyIDSigner] = spork;
return true;
}

Expand Down

0 comments on commit a5d2edb

Please sign in to comment.