|
7 | 7 | #include <stdarg.h>
|
8 | 8 | #include <stdbool.h>
|
9 | 9 | #include <stdint.h>
|
10 |
| -#include <stdlib.h> |
| 10 | + |
11 | 11 |
|
12 | 12 | /**
|
13 | 13 | * An error when accessing the chain via [`Access`].
|
@@ -174,8 +174,8 @@ typedef enum LDKSecp256k1Error {
|
174 | 174 | LDKSecp256k1Error_InvalidSecretKey,
|
175 | 175 | LDKSecp256k1Error_InvalidRecoveryId,
|
176 | 176 | LDKSecp256k1Error_InvalidTweak,
|
| 177 | + LDKSecp256k1Error_TweakCheckFailed, |
177 | 178 | LDKSecp256k1Error_NotEnoughMemory,
|
178 |
| - LDKSecp256k1Error_CallbackPanicked, |
179 | 179 | /**
|
180 | 180 | * Must be last for serialization purposes
|
181 | 181 | */
|
@@ -3451,6 +3451,25 @@ typedef struct LDKAccess {
|
3451 | 3451 | void (*free)(void *this_arg);
|
3452 | 3452 | } LDKAccess;
|
3453 | 3453 |
|
| 3454 | +/** |
| 3455 | + * The `Listen` trait is used to be notified of when blocks have been connected or disconnected |
| 3456 | + * from the chain. |
| 3457 | + * |
| 3458 | + * Useful when needing to replay chain data upon startup or as new chain events occur. |
| 3459 | + */ |
| 3460 | +typedef struct LDKListen { |
| 3461 | + void *this_arg; |
| 3462 | + /** |
| 3463 | + * Notifies the listener that a block was added at the given height. |
| 3464 | + */ |
| 3465 | + void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height); |
| 3466 | + /** |
| 3467 | + * Notifies the listener that a block was removed at the given height. |
| 3468 | + */ |
| 3469 | + void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height); |
| 3470 | + void (*free)(void *this_arg); |
| 3471 | +} LDKListen; |
| 3472 | + |
3454 | 3473 | /**
|
3455 | 3474 | * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
|
3456 | 3475 | * channels.
|
@@ -3629,7 +3648,7 @@ typedef struct LDKChannelMessageHandler {
|
3629 | 3648 | /**
|
3630 | 3649 | * Handle an incoming shutdown message from the given peer.
|
3631 | 3650 | */
|
3632 |
| - void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg); |
| 3651 | + void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg); |
3633 | 3652 | /**
|
3634 | 3653 | * Handle an incoming closing_signed message from the given peer.
|
3635 | 3654 | */
|
@@ -5117,6 +5136,11 @@ enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR ori
|
5117 | 5136 | */
|
5118 | 5137 | void Access_free(struct LDKAccess this_ptr);
|
5119 | 5138 |
|
| 5139 | +/** |
| 5140 | + * Calls the free function if one is set |
| 5141 | + */ |
| 5142 | +void Listen_free(struct LDKListen this_ptr); |
| 5143 | + |
5120 | 5144 | /**
|
5121 | 5145 | * Calls the free function if one is set
|
5122 | 5146 | */
|
@@ -5667,8 +5691,8 @@ void KeysManager_free(struct LDKKeysManager this_ptr);
|
5667 | 5691 | MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
|
5668 | 5692 |
|
5669 | 5693 | /**
|
5670 |
| - * Derive an old set of Sign for per-channel secrets based on a key derivation |
5671 |
| - * parameters. |
| 5694 | + * Derive an old Sign containing per-channel secrets based on a key derivation parameters. |
| 5695 | + * |
5672 | 5696 | * Key derivation parameters are accessible through a per-channel secrets
|
5673 | 5697 | * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
|
5674 | 5698 | * onchain output detection for which a corresponding delayed_payment_key must be derived.
|
@@ -6029,6 +6053,8 @@ struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(
|
6029 | 6053 |
|
6030 | 6054 | struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
|
6031 | 6055 |
|
| 6056 | +struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg); |
| 6057 | + |
6032 | 6058 | /**
|
6033 | 6059 | * Updates channel state based on transactions seen in a connected block.
|
6034 | 6060 | */
|
|
0 commit comments