Skip to content

Commit

Permalink
bitcoingui: fix network weight, etc, not updating when many peers are…
Browse files Browse the repository at this point in the history
… lagging

If the median of the peers' block count is less than our block count,
things like network weight, etc, will not be updated. If we are connected
with slow to update peers, this can mean those update very seldom.
We now update those values when we're equal or above the median value.
  • Loading branch information
Your Name committed Sep 15, 2014
1 parent 67b6b85 commit e34fe07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ void BitcoinGUI::updateMintingIcon()
void BitcoinGUI::updateMintingWeights()
{
// Only update if we have the network's current number of blocks, or weight(s) are zero (fixes lagging GUI)
if ((clientModel && clientModel->getNumBlocks() == clientModel->getNumBlocksOfPeers()) || !nWeight || !nNetworkWeight)
if ((clientModel && clientModel->getNumBlocks() >= clientModel->getNumBlocksOfPeers()) || !nWeight || !nNetworkWeight)
{
nWeight = 0;
nCharityPercent = 0;
Expand Down

0 comments on commit e34fe07

Please sign in to comment.