diff options
| author | Pieter Wuille <[email protected]> | 2013-10-19 15:55:08 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2013-10-26 14:43:26 +0200 |
| commit | a616206865d62106944300d7b912e3af8d357610 (patch) | |
| tree | 18e4c06383c1f3ce6a2bda72857afe787fadaeef /src/main.cpp | |
| parent | Merge pull request #3144 from Diapolo/message_sendcoinsdialog (diff) | |
| download | discoin-a616206865d62106944300d7b912e3af8d357610.tar.xz discoin-a616206865d62106944300d7b912e3af8d357610.zip | |
Give peer time-adjustment data an own lock
Instead of relying on cs_main (defined in a different module) to
prevent concurrent access to it.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 01a1babc7..ca58d9313 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,7 +49,7 @@ int64 CTransaction::nMinTxFee = 10000; // Override with -mintxfee /** Fees smaller than this (in satoshi) are considered zero fee (for relaying) */ int64 CTransaction::nMinRelayTxFee = 10000; -CMedianFilter<int> cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have +static CMedianFilter<int> cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have map<uint256, CBlock*> mapOrphanBlocks; multimap<uint256, CBlock*> mapOrphanBlocksByPrev; @@ -3460,8 +3460,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) LogPrintf("receive version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString().c_str(), addrFrom.ToString().c_str(), pfrom->addr.ToString().c_str()); - LOCK(cs_main); AddTimeData(pfrom->addr, nTime); + + LOCK(cs_main); cPeerBlockCounts.input(pfrom->nStartingHeight); } |