changeset 23691:f98a04323801

Fix for locking issue and compile warning 1) Potential Deadlock using cs_filter: (G.A. Stone) 2) Compile warning - no return value : (sickpig) 3) Edit re-request thinblock message: (sickpig)
author Peter Tschipper <peter.tschipper@gmailcom>
date Wed, 17 Feb 2016 03:26:56 -0800
parents 8be78259f37f
children fa7ed78c4b21
files src/main.cpp src/unlimited.cpp src/unlimited.h
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.cpp	Tue Feb 16 18:04:56 2016 -0500
+++ b/src/main.cpp	Wed Feb 17 03:26:56 2016 -0800
@@ -5103,7 +5103,7 @@
             // Re-request transactions that we are still missing
             CXThinBlockTx thinBlockTx(thinBlock.header.GetHash(), vHashesToRequest);
             pfrom->PushMessage(NetMsgType::GET_XBLOCKTX, thinBlockTx);
-            LogPrint("thin", "Missing %d transactions for xthinblock, re-requesting (consider adjusting relay policies)\n", 
+            LogPrint("thin", "Missing %d transactions for xthinblock, re-requesting\n", 
                       pfrom->thinBlockWaitingForTxns);
         }
     }
--- a/src/unlimited.cpp	Tue Feb 16 18:04:56 2016 -0500
+++ b/src/unlimited.cpp	Wed Feb 17 03:26:56 2016 -0800
@@ -574,7 +574,7 @@
     return true;
 }
 
-bool ClearThinBlockTimer(uint256 hash)
+void ClearThinBlockTimer(uint256 hash)
 {
     if (mapThinBlockTimer.count(hash)) {
         mapThinBlockTimer.erase(hash);
@@ -610,8 +610,8 @@
     memPoolFilter = CBloomFilter(nElements, nFPRate, insecure_rand(), BLOOM_UPDATE_ALL);
     LogPrint("thin", "Bloom multiplier: %f FPrate: %f Num elements in bloom filter: %d num mempool entries: %d\n", nBloomDecay, nFPRate, nElements, (int)mempool.mapTx.size());
 
-    // Seed the filter with the transactions in the memory pool, orphan pool and relay pool
-    LOCK2(cs_main, pto->cs_filter);
+    // Seed the filter with the transactions in the memory pool
+    LOCK(cs_main);
     std::vector<uint256> memPoolHashes;
     mempool.queryHashes(memPoolHashes);
     for (uint64_t i = 0; i < memPoolHashes.size(); i++)
--- a/src/unlimited.h	Tue Feb 16 18:04:56 2016 -0500
+++ b/src/unlimited.h	Wed Feb 17 03:26:56 2016 -0800
@@ -61,7 +61,7 @@
 extern bool HaveConnectThinblockNodes();
 extern bool HaveThinblockNodes();
 extern bool CheckThinblockTimer(uint256 hash);
-extern bool ClearThinblockTimer(uint256 hash);
+extern void ClearThinblockTimer(uint256 hash);
 extern bool IsThinBlocksEnabled();
 extern bool IsChainNearlySyncd();
 extern void SendSeededBloomFilter(CNode *pto);