Fixes #20975
Also replace the wallet pointer by a reference
Fixes #20975
Also replace the wallet pointer by a reference
This reverts commit faa94961d6e38392ba068381726ed4e033367b03.
Can be tested with:
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index 1e07ff23ae..07876b7d55 100644
--- a/src/validationinterface.cpp
+++ b/src/validationinterface.cpp
@@ -8,6 +8,7 @@
#include <chain.h>
#include <consensus/validation.h>
#include <logging.h>
+#include <util/time.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <scheduler.h>
@@ -219,6 +220,7 @@ void CMainSignals::TransactionRemovedFromMempool(const CTransactionRef& tx, MemP
void CMainSignals::BlockConnected(const std::shared_ptr<const CBlock> &pblock, const CBlockIndex *pindex) {
auto event = [pblock, pindex, this] {
+ UninterruptibleSleep(100ms);
m_internals->Iterate([&](CValidationInterface& callbacks) { callbacks.BlockConnected(pblock, pindex); });
};
ENQUEUE_AND_LOG_EVENT(event, "%s: block hash=%s block height=%d", __func__,
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
ACK fa27baa9c8a13239625e5a7b6c472d236fe5b9fa
Was able to replicate the race condition on master with the provided diff, and verified it is no longer occurring with this PR.
Milestone
22.0