aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-06-15 09:58:21 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-06-15 09:58:26 -0400
commit43fa3554b7597c4d57164716c5f0746f886e3f54 (patch)
treed727f4eb2fba8592fa2ec7261c96102a6cdfa8ba /src/validation.cpp
parent32bf4c619d2aac0548630d77a55e6c133b9a28ce (diff)
parent25bc9615b7480e4ba2c482a6f0e7e3b33f50e6e0 (diff)
Merge #13402: Document validationinterace callback blocking deadlock potential.
25bc9615b7 Document validationinterace callback blocking deadlock potential. (Matt Corallo) Pull request description: From the branches-I've-had-lying-around-and-forgot-to-PR department... This is a comment-only PR, but the comments point out an API quirk that isn't exactly trivial. None of our use-cases right now hit this, but if we were to call SyncWithValidationInterfaceQueue (eg to limit queue depth) in ATMP, I'm pretty sure we'd hit a deadlock there. Tree-SHA512: 889dd8fc9eb15d1f2aa5ca467e783bc8f07bc543b166b032741795b0db7a0df11a2846d3cb7c69bafa8d1acf970021001b742f52be06725a932813230c5b4a7b
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index bbf2389d34..d94b7c7d06 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2698,6 +2698,9 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams&
// Block until the validation queue drains. This should largely
// never happen in normal operation, however may happen during
// reindex, causing memory blowup if we run too far ahead.
+ // Note that if a validationinterface callback ends up calling
+ // ActivateBestChain this may lead to a deadlock! We should
+ // probably have a DEBUG_LOCKORDER test for this in the future.
SyncWithValidationInterfaceQueue();
}