Push cs_main locks down in ProcessBlock #4148
pull sipa wants to merge 4 commits into bitcoin:master from sipa:headersfirst6 changing 4 files +136 −114-
sipa commented at 8:57 pm on May 7, 2014: memberFor now, built on top of #3884.
-
laanwj added this to the milestone 0.10.0 on May 8, 2014
-
in src/main.cpp: in ed85993dc1 outdated
2188+ 2189+bool ActivateBestChain(CValidationState &state) { 2190+ CBlockIndex *pindexNewTip = NULL; 2191+ CBlockIndex *pindexMostWork = NULL; 2192+ do { 2193+ bool fInitialDownload;
laanwj commented at 8:33 pm on May 8, 2014:Should we have aboost::this_thread::interruption_point()here?
sipa commented at 9:39 pm on May 8, 2014:Good idea!laanwj commented at 1:22 pm on May 19, 2014: memberACK on code changes Also I’ve run with this patch for about a week now on my node. No problems.jgarzik commented at 1:46 pm on May 19, 2014: contributorinitial review ACK (untested).
I will try some lock-debug testing later this week.
in src/main.cpp: in f6a6adcc43 outdated
2225+ uint256 hashNewTip = pindexNewTip->GetBlockHash(); 2226+ // Relay inventory, but don't relay old inventory during initial block download. 2227+ int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(); 2228+ LOCK(cs_vNodes); 2229+ BOOST_FOREACH(CNode* pnode, vNodes) 2230+ if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate))
cozz commented at 6:24 pm on May 19, 2014:Isn’t chainActive here and a few lines below accessed without cs_main?
laanwj commented at 10:52 am on May 23, 2014: memberI still haven’t had any segfaults running with this.Get rid of the static chainMostWork (optimization) 77339e5aecAllow ActivateBestChain to release its lock on cs_main 4e0eed88acMove all post-chaintip-change notifications to ActivateBestChain 202e01941cPush cs_mains down in ProcessBlock 18e72167ddBitcoinPullTester commented at 0:38 am on June 9, 2014: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/18e72167ddfeaea95253b62994c6d64b55b35005 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.laanwj commented at 8:11 am on June 9, 2014: memberACKlaanwj merged this on Jun 9, 2014laanwj closed this on Jun 9, 2014
laanwj referenced this in commit 07b233a1b6 on Jun 9, 2014in src/main.cpp: in 18e72167dd
2663@@ -2649,7 +2664,11 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl 2664 mapOrphanBlocksByPrev.erase(hashPrev); 2665 } 2666 2667- LogPrintf("ProcessBlock: ACCEPTED\n");
DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-13 09:13 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me