aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Cohen <jc@jc.lol>2018-05-16 16:20:37 -0400
committerJesse Cohen <jc@jc.lol>2018-07-30 19:41:59 -0400
commitcbeaa91dbb1bc3ee6c05f3ee55a71268b8db2035 (patch)
treeafdb8bf551425194e3011f07e7187c36d831a3f5
parentb296b425a7d35a285764d8b5be09a069a9a5a020 (diff)
downloadbitcoin-cbeaa91dbb1bc3ee6c05f3ee55a71268b8db2035.tar.xz
Update ValidationInterface() documentation to explicitly specify threading and memory model
-rw-r--r--src/validationinterface.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/validationinterface.h b/src/validationinterface.h
index 63097166af..00efc085b3 100644
--- a/src/validationinterface.h
+++ b/src/validationinterface.h
@@ -53,6 +53,21 @@ void CallFunctionInValidationInterfaceQueue(std::function<void ()> func);
*/
void SyncWithValidationInterfaceQueue();
+/**
+ * Implement this to subscribe to events generated in validation
+ *
+ * Each CValidationInterface() subscriber will receive event callbacks
+ * in the order in which the events were generated by validation.
+ * Furthermore, each ValidationInterface() subscriber may assume that
+ * callbacks effectively run in a single thread with single-threaded
+ * memory consistency. That is, for a given ValidationInterface()
+ * instantiation, each callback will complete before the next one is
+ * invoked. This means, for example when a block is connected that the
+ * UpdatedBlockTip() callback may depend on an operation performed in
+ * the BlockConnected() callback without worrying about explicit
+ * synchronization. No ordering should be assumed across
+ * ValidationInterface() subscribers.
+ */
class CValidationInterface {
protected:
/**