aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-05-05 19:43:14 +0200
committerlangerhans <[email protected]>2014-06-29 15:38:34 +0200
commit72a22c18ffd0637745aa10d2a8dd4605e65664a9 (patch)
tree0d2a0c362fd4d879f9e761f43fc3832cc9fae757 /src/main.cpp
parentrpc: add `getblockchaininfo` and `getnetworkinfo` (diff)
downloaddiscoin-72a22c18ffd0637745aa10d2a8dd4605e65664a9.tar.xz
discoin-72a22c18ffd0637745aa10d2a8dd4605e65664a9.zip
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 c8a70488b..2f57199b2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -59,8 +59,6 @@ int64_t CTransaction::nMinTxFee = 100000000; // Override with -mintxfee
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */
int64_t CTransaction::nMinRelayTxFee = 100000000;
-static CMedianFilter<int> cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have
-
struct COrphanBlock {
uint256 hashBlock;
uint256 hashPrev;
@@ -1389,12 +1387,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);
@@ -3674,9 +3666,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);
}