@@ -28,7 +28,7 @@ void broadcast_tx(const void *this_arg, LDKTransaction tx) {
28
28
LDKChannelMonitorUpdateStatus add_channel_monitor (const void * this_arg , LDKOutPoint funding_txo , LDKChannelMonitor monitor ) {
29
29
return ChannelMonitorUpdateStatus_completed ();
30
30
}
31
- LDKChannelMonitorUpdateStatus update_channel_monitor (const void * this_arg , LDKOutPoint funding_txo , LDKChannelMonitorUpdate monitor ) {
31
+ LDKChannelMonitorUpdateStatus update_channel_monitor (const void * this_arg , LDKOutPoint funding_txo , const LDKChannelMonitorUpdate * monitor ) {
32
32
return ChannelMonitorUpdateStatus_completed ();
33
33
}
34
34
LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ monitors_pending_monitor_events (const void * this_arg ) {
@@ -44,6 +44,16 @@ void never_handle_event(const void *this_arg, const struct LDKEvent event) {
44
44
assert (false);
45
45
}
46
46
47
+ LDKCResult_RouteLightningErrorZ do_find_route (const void * this_arg , LDKPublicKey payer , const LDKRouteParameters * route_params , LDKCVec_ChannelDetailsZ * first_hops , const LDKInFlightHtlcs * inflight_htlcs ) {
48
+ LDKStr reason = { .chars = (const unsigned char * )"" , .len = 0 , .chars_is_owned = false };
49
+ return CResult_RouteLightningErrorZ_err (LightningError_new (reason , ErrorAction_ignore_error ()));
50
+ }
51
+
52
+ LDKCResult_RouteLightningErrorZ do_find_route_with_id (const void * this_arg , LDKPublicKey payer , const LDKRouteParameters * route_params , LDKCVec_ChannelDetailsZ * first_hops , const LDKInFlightHtlcs * inflight_htlcs , struct LDKThirtyTwoBytes payment_hash , struct LDKThirtyTwoBytes payment_id ) {
53
+ LDKStr reason = { .chars = (const unsigned char * )"" , .len = 0 , .chars_is_owned = false };
54
+ return CResult_RouteLightningErrorZ_err (LightningError_new (reason , ErrorAction_ignore_error ()));
55
+ }
56
+
47
57
int main () {
48
58
uint8_t node_seed [32 ];
49
59
memset (node_seed , 0 , 32 );
@@ -71,19 +81,28 @@ int main() {
71
81
};
72
82
73
83
LDKBroadcasterInterface broadcast = {
74
- broadcast .this_arg = NULL ,
75
- broadcast .broadcast_transaction = broadcast_tx ,
84
+ .this_arg = NULL ,
85
+ .broadcast_transaction = broadcast_tx ,
86
+ .free = NULL ,
87
+ };
88
+
89
+ LDKRouter router = {
90
+ .this_arg = NULL ,
91
+ .find_route = do_find_route ,
92
+ .find_route_with_id = do_find_route_with_id ,
76
93
.free = NULL ,
77
94
};
78
95
79
96
LDKKeysManager keys = KeysManager_new (& node_seed , 0 , 0 );
80
- LDKKeysInterface keys_source = KeysManager_as_KeysInterface (& keys );
97
+ LDKEntropySource entropy_source = KeysManager_as_EntropySource (& keys );
98
+ LDKNodeSigner node_signer = KeysManager_as_NodeSigner (& keys );
99
+ LDKSignerProvider signer_provider = KeysManager_as_SignerProvider (& keys );
81
100
82
101
LDKUserConfig config = UserConfig_default ();
83
102
LDKThirtyTwoBytes chain_tip ;
84
103
memset (& chain_tip , 0 , 32 );
85
104
LDKChainParameters chain = ChainParameters_new (net , BestBlock_new (chain_tip , 0 ));
86
- LDKChannelManager cm = ChannelManager_new (fee_est , mon , broadcast , logger , keys_source , config , chain );
105
+ LDKChannelManager cm = ChannelManager_new (fee_est , mon , broadcast , router , logger , entropy_source , node_signer , signer_provider , config , chain );
87
106
88
107
LDKCVec_ChannelDetailsZ channels = ChannelManager_list_channels (& cm );
89
108
assert ((unsigned long )channels .data < 4096 ); // There's an offset, but it should still be an offset against null in the 0 page
0 commit comments