Skip to content

Commit 9899893

Browse files
committed
Move wallet callbacks into cs_main (this effectively reverts #7946)
1 parent 054d664 commit 9899893

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
@@ -2473,20 +2473,19 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
24732473
pindexNewTip = chainActive.Tip();
24742474
pindexFork = chainActive.FindFork(pindexOldTip);
24752475
fInitialDownload = IsInitialBlockDownload();
2476+
2477+
// throw all transactions though the signal-interface
2478+
for (const auto& pair : connectTrace.blocksConnected) {
2479+
assert(pair.second);
2480+
const CBlock& block = *(pair.second);
2481+
for (unsigned int i = 0; i < block.vtx.size(); i++)
2482+
GetMainSignals().SyncTransaction(*block.vtx[i], pair.first, i);
2483+
}
24762484
}
24772485
// When we reach this point, we switched to a new tip (stored in pindexNewTip).
24782486

24792487
// Notifications/callbacks that can run without cs_main
24802488

2481-
// throw all transactions though the signal-interface
2482-
// while _not_ holding the cs_main lock
2483-
for (const auto& pair : connectTrace.blocksConnected) {
2484-
assert(pair.second);
2485-
const CBlock& block = *(pair.second);
2486-
for (unsigned int i = 0; i < block.vtx.size(); i++)
2487-
GetMainSignals().SyncTransaction(*block.vtx[i], pair.first, i);
2488-
}
2489-
24902489
// Notify external listeners about the new tip.
24912490
GetMainSignals().UpdatedBlockTip(pindexNewTip, pindexFork, fInitialDownload);
24922491

0 commit comments

Comments
 (0)