From c62f657ba330572969ab5e86c739712e800bcbcb Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Mon, 3 Jun 2024 14:51:29 +0200 Subject: [PATCH] kernel: Add notifications context option to C header The notifications are used for notifying on connected blocks and on warning and fatal error conditions. The user of the C header may define callbacks that gets passed to the internal notification object in the `kernel_NotificationInterfaceCallbacks` struct. Each of the callbacks take a `user_data` argument that gets populated from the `user_data` value in the struct. It can be used to recreate the structure containing the callbacks on the user's side, or to give the callbacks additional contextual information. --- src/kernel/bitcoinkernel.cpp | 103 ++++++++++++++++++++++++++++- src/kernel/bitcoinkernel.h | 79 +++++++++++++++++++++- src/kernel/bitcoinkernel_wrapper.h | 61 +++++++++++++++++ src/test/kernel/test_kernel.cpp | 30 +++++++++ 4 files changed, 270 insertions(+), 3 deletions(-) diff --git a/src/kernel/bitcoinkernel.cpp b/src/kernel/bitcoinkernel.cpp index 35e03372f6b..2670287ab4a 100644 --- a/src/kernel/bitcoinkernel.cpp +++ b/src/kernel/bitcoinkernel.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include