Skip to content

Commit 9ba8a31

Browse files
laanwjcodablock
authored andcommitted
Merge bitcoin#9583: Move wallet callbacks into cs_main (this effectively reverts bitcoin#7946)
9899893 Move wallet callbacks into cs_main (this effectively reverts bitcoin#7946) (Matt Corallo)
1 parent 6bc16a6 commit 9ba8a31

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/validation.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,20 +2900,19 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
29002900
pindexNewTip = chainActive.Tip();
29012901
pindexFork = chainActive.FindFork(pindexOldTip);
29022902
fInitialDownload = IsInitialBlockDownload();
2903+
2904+
// throw all transactions though the signal-interface
2905+
for (const auto& pair : connectTrace.blocksConnected) {
2906+
assert(pair.second);
2907+
const CBlock& block = *(pair.second);
2908+
for (unsigned int i = 0; i < block.vtx.size(); i++)
2909+
GetMainSignals().SyncTransaction(*block.vtx[i], pair.first, i);
2910+
}
29032911
}
29042912
// When we reach this point, we switched to a new tip (stored in pindexNewTip).
29052913

29062914
// Notifications/callbacks that can run without cs_main
29072915

2908-
// throw all transactions though the signal-interface
2909-
// while _not_ holding the cs_main lock
2910-
for (const auto& pair : connectTrace.blocksConnected) {
2911-
assert(pair.second);
2912-
const CBlock& block = *(pair.second);
2913-
for (unsigned int i = 0; i < block.vtx.size(); i++)
2914-
GetMainSignals().SyncTransaction(*block.vtx[i], pair.first, i);
2915-
}
2916-
29172916
// Notify external listeners about the new tip.
29182917
GetMainSignals().UpdatedBlockTip(pindexNewTip, pindexFork, fInitialDownload);
29192918

0 commit comments

Comments
 (0)