aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-05-05 19:43:14 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-07-04 06:58:45 +0200
commit752ecec5cc055506bf9e905a60a96068ea9f92bc (patch)
tree357f8c13ba046df9fd0fac2dfe353891a5b7d3e4 /src/main.cpp
parent354c0f382b9a0d6701cb43a8ee379d7c0ef5d34d (diff)
downloadbitcoin-752ecec5cc055506bf9e905a60a96068ea9f92bc.tar.xz
Remove NumBlocksOfPeers
Generally useless information. Only updates on connect time, not after that. Peers can easily lie and the median filter is not effective in preventing that. In the past it was used for progress display in the GUI but `CheckPoints::guessVerificationProgress` provides a better way that is now used. It was too easy to mislead it. Peers do lie about it in practice, see issue #4065. From the RPC, `getpeerinfo` gives the peer raw values, which are more useful.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0b5455858a..dc38d1159d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -54,8 +54,6 @@ int64_t CTransaction::nMinTxFee = 10000; // Override with -mintxfee
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */
int64_t CTransaction::nMinRelayTxFee = 1000;
-static CMedianFilter<int> cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have
-
struct COrphanBlock {
uint256 hashBlock;
uint256 hashPrev;
@@ -1303,12 +1301,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
return true;
}
-// Return maximum amount of blocks that other nodes claim to have
-int GetNumBlocksOfPeers()
-{
- return std::max(cPeerBlockCounts.median(), Checkpoints::GetTotalBlocksEstimate());
-}
-
bool IsInitialBlockDownload()
{
LOCK(cs_main);
@@ -3488,9 +3480,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", pfrom->cleanSubVer, pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString(), addrFrom.ToString(), pfrom->addr.ToString());
AddTimeData(pfrom->addr, nTime);
-
- LOCK(cs_main);
- cPeerBlockCounts.input(pfrom->nStartingHeight);
}