Skip to content

Commit cbeaa91

Browse files
committed
Update ValidationInterface() documentation to explicitly specify threading and memory model
1 parent b296b42 commit cbeaa91

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/validationinterface.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ void CallFunctionInValidationInterfaceQueue(std::function<void ()> func);
5353
*/
5454
void SyncWithValidationInterfaceQueue();
5555

56+
/**
57+
* Implement this to subscribe to events generated in validation
58+
*
59+
* Each CValidationInterface() subscriber will receive event callbacks
60+
* in the order in which the events were generated by validation.
61+
* Furthermore, each ValidationInterface() subscriber may assume that
62+
* callbacks effectively run in a single thread with single-threaded
63+
* memory consistency. That is, for a given ValidationInterface()
64+
* instantiation, each callback will complete before the next one is
65+
* invoked. This means, for example when a block is connected that the
66+
* UpdatedBlockTip() callback may depend on an operation performed in
67+
* the BlockConnected() callback without worrying about explicit
68+
* synchronization. No ordering should be assumed across
69+
* ValidationInterface() subscribers.
70+
*/
5671
class CValidationInterface {
5772
protected:
5873
/**

0 commit comments

Comments
 (0)