@@ -12,6 +12,7 @@ static void db_log_(struct log *log UNUSED, enum log_level level UNUSED, const c
1212#include "wallet/wallet.c"
1313#include "lightningd/htlc_end.c"
1414#include "lightningd/peer_control.c"
15+ #include "lightningd/peer_htlcs.c"
1516#include "lightningd/channel.c"
1617
1718#include "wallet/db.c"
@@ -69,12 +70,30 @@ void delay_then_reconnect(struct channel *channel UNNEEDED, u32 seconds_delay UN
6970/* Generated stub for fatal */
7071void fatal (const char * fmt UNNEEDED , ...)
7172{ fprintf (stderr , "fatal called!\n" ); abort (); }
73+ /* Generated stub for fromwire_channel_got_commitsig */
74+ bool fromwire_channel_got_commitsig (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , u64 * commitnum UNNEEDED , u32 * feerate UNNEEDED , secp256k1_ecdsa_signature * signature UNNEEDED , secp256k1_ecdsa_signature * * htlc_signature UNNEEDED , struct added_htlc * * added UNNEEDED , struct secret * * shared_secret UNNEEDED , struct fulfilled_htlc * * fulfilled UNNEEDED , struct failed_htlc * * * failed UNNEEDED , struct changed_htlc * * changed UNNEEDED , struct bitcoin_tx * * tx UNNEEDED )
75+ { fprintf (stderr , "fromwire_channel_got_commitsig called!\n" ); abort (); }
76+ /* Generated stub for fromwire_channel_got_revoke */
77+ bool fromwire_channel_got_revoke (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , u64 * revokenum UNNEEDED , struct secret * per_commitment_secret UNNEEDED , struct pubkey * next_per_commit_point UNNEEDED , u32 * feerate UNNEEDED , struct changed_htlc * * changed UNNEEDED )
78+ { fprintf (stderr , "fromwire_channel_got_revoke called!\n" ); abort (); }
79+ /* Generated stub for fromwire_channel_offer_htlc_reply */
80+ bool fromwire_channel_offer_htlc_reply (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , u64 * id UNNEEDED , u16 * failure_code UNNEEDED , u8 * * failurestr UNNEEDED )
81+ { fprintf (stderr , "fromwire_channel_offer_htlc_reply called!\n" ); abort (); }
82+ /* Generated stub for fromwire_channel_sending_commitsig */
83+ bool fromwire_channel_sending_commitsig (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , u64 * commitnum UNNEEDED , u32 * feerate UNNEEDED , struct changed_htlc * * changed UNNEEDED , secp256k1_ecdsa_signature * commit_sig UNNEEDED , secp256k1_ecdsa_signature * * htlc_sigs UNNEEDED )
84+ { fprintf (stderr , "fromwire_channel_sending_commitsig called!\n" ); abort (); }
7285/* Generated stub for fromwire_connect_peer_connected */
7386bool fromwire_connect_peer_connected (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , struct pubkey * id UNNEEDED , struct wireaddr_internal * addr UNNEEDED , struct crypto_state * crypto_state UNNEEDED , u8 * * gfeatures UNNEEDED , u8 * * lfeatures UNNEEDED )
7487{ fprintf (stderr , "fromwire_connect_peer_connected called!\n" ); abort (); }
88+ /* Generated stub for fromwire_gossip_resolve_channel_reply */
89+ bool fromwire_gossip_resolve_channel_reply (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , struct pubkey * * keys UNNEEDED )
90+ { fprintf (stderr , "fromwire_gossip_resolve_channel_reply called!\n" ); abort (); }
7591/* Generated stub for fromwire_hsm_sign_commitment_tx_reply */
7692bool fromwire_hsm_sign_commitment_tx_reply (const void * p UNNEEDED , secp256k1_ecdsa_signature * sig UNNEEDED )
7793{ fprintf (stderr , "fromwire_hsm_sign_commitment_tx_reply called!\n" ); abort (); }
94+ /* Generated stub for get_block_height */
95+ u32 get_block_height (const struct chain_topology * topo UNNEEDED )
96+ { fprintf (stderr , "get_block_height called!\n" ); abort (); }
7897/* Generated stub for invoices_autoclean_set */
7998void invoices_autoclean_set (struct invoices * invoices UNNEEDED ,
8099 u64 cycle_seconds UNNEEDED ,
@@ -275,6 +294,9 @@ enum watch_result onchaind_funding_spent(struct channel *channel UNNEEDED,
275294 const struct bitcoin_tx * tx UNNEEDED ,
276295 u32 blockheight UNNEEDED )
277296{ fprintf (stderr , "onchaind_funding_spent called!\n" ); abort (); }
297+ /* Generated stub for onion_type_name */
298+ const char * onion_type_name (int e UNNEEDED )
299+ { fprintf (stderr , "onion_type_name called!\n" ); abort (); }
278300/* Generated stub for opening_peer_no_active_channels */
279301void opening_peer_no_active_channels (struct peer * peer UNNEEDED )
280302{ fprintf (stderr , "opening_peer_no_active_channels called!\n" ); abort (); }
@@ -297,6 +319,24 @@ void outpointfilter_remove(struct outpointfilter *of UNNEEDED,
297319bool param (struct command * cmd UNNEEDED , const char * buffer UNNEEDED ,
298320 const jsmntok_t params [] UNNEEDED , ...)
299321{ fprintf (stderr , "param called!\n" ); abort (); }
322+ /* Generated stub for parse_onionpacket */
323+ struct onionpacket * parse_onionpacket (
324+ const tal_t * ctx UNNEEDED ,
325+ const void * src UNNEEDED ,
326+ const size_t srclen
327+ )
328+ { fprintf (stderr , "parse_onionpacket called!\n" ); abort (); }
329+ /* Generated stub for payment_failed */
330+ void payment_failed (struct lightningd * ld UNNEEDED , const struct htlc_out * hout UNNEEDED ,
331+ const char * localfail UNNEEDED )
332+ { fprintf (stderr , "payment_failed called!\n" ); abort (); }
333+ /* Generated stub for payment_store */
334+ void payment_store (struct lightningd * ld UNNEEDED , const struct sha256 * payment_hash UNNEEDED )
335+ { fprintf (stderr , "payment_store called!\n" ); abort (); }
336+ /* Generated stub for payment_succeeded */
337+ void payment_succeeded (struct lightningd * ld UNNEEDED , struct htlc_out * hout UNNEEDED ,
338+ const struct preimage * rval UNNEEDED )
339+ { fprintf (stderr , "payment_succeeded called!\n" ); abort (); }
300340/* Generated stub for peer_start_channeld */
301341void peer_start_channeld (struct channel * channel UNNEEDED ,
302342 const struct crypto_state * cs UNNEEDED ,
@@ -317,6 +357,20 @@ void peer_start_openingd(struct peer *peer UNNEEDED,
317357 int peer_fd UNNEEDED , int gossip_fd UNNEEDED ,
318358 const u8 * msg UNNEEDED )
319359{ fprintf (stderr , "peer_start_openingd called!\n" ); abort (); }
360+ /* Generated stub for process_onionpacket */
361+ struct route_step * process_onionpacket (
362+ const tal_t * ctx UNNEEDED ,
363+ const struct onionpacket * packet UNNEEDED ,
364+ const u8 * shared_secret UNNEEDED ,
365+ const u8 * assocdata UNNEEDED ,
366+ const size_t assocdatalen
367+ )
368+ { fprintf (stderr , "process_onionpacket called!\n" ); abort (); }
369+ /* Generated stub for serialize_onionpacket */
370+ u8 * serialize_onionpacket (
371+ const tal_t * ctx UNNEEDED ,
372+ const struct onionpacket * packet UNNEEDED )
373+ { fprintf (stderr , "serialize_onionpacket called!\n" ); abort (); }
320374/* Generated stub for subd_release_channel */
321375void subd_release_channel (struct subd * owner UNNEEDED , void * channel UNNEEDED )
322376{ fprintf (stderr , "subd_release_channel called!\n" ); abort (); }
@@ -334,6 +388,24 @@ void subd_send_msg(struct subd *sd UNNEEDED, const u8 *msg_out UNNEEDED)
334388/* Generated stub for towire_channel_dev_reenable_commit */
335389u8 * towire_channel_dev_reenable_commit (const tal_t * ctx UNNEEDED )
336390{ fprintf (stderr , "towire_channel_dev_reenable_commit called!\n" ); abort (); }
391+ /* Generated stub for towire_channel_fail_htlc */
392+ u8 * towire_channel_fail_htlc (const tal_t * ctx UNNEEDED , const struct failed_htlc * failed_htlc UNNEEDED )
393+ { fprintf (stderr , "towire_channel_fail_htlc called!\n" ); abort (); }
394+ /* Generated stub for towire_channel_fulfill_htlc */
395+ u8 * towire_channel_fulfill_htlc (const tal_t * ctx UNNEEDED , const struct fulfilled_htlc * fulfilled_htlc UNNEEDED )
396+ { fprintf (stderr , "towire_channel_fulfill_htlc called!\n" ); abort (); }
397+ /* Generated stub for towire_channel_got_commitsig_reply */
398+ u8 * towire_channel_got_commitsig_reply (const tal_t * ctx UNNEEDED )
399+ { fprintf (stderr , "towire_channel_got_commitsig_reply called!\n" ); abort (); }
400+ /* Generated stub for towire_channel_got_revoke_reply */
401+ u8 * towire_channel_got_revoke_reply (const tal_t * ctx UNNEEDED )
402+ { fprintf (stderr , "towire_channel_got_revoke_reply called!\n" ); abort (); }
403+ /* Generated stub for towire_channel_offer_htlc */
404+ u8 * towire_channel_offer_htlc (const tal_t * ctx UNNEEDED , u64 amount_msat UNNEEDED , u32 cltv_expiry UNNEEDED , const struct sha256 * payment_hash UNNEEDED , const u8 onion_routing_packet [1366 ])
405+ { fprintf (stderr , "towire_channel_offer_htlc called!\n" ); abort (); }
406+ /* Generated stub for towire_channel_sending_commitsig_reply */
407+ u8 * towire_channel_sending_commitsig_reply (const tal_t * ctx UNNEEDED )
408+ { fprintf (stderr , "towire_channel_sending_commitsig_reply called!\n" ); abort (); }
337409/* Generated stub for towire_channel_send_shutdown */
338410u8 * towire_channel_send_shutdown (const tal_t * ctx UNNEEDED )
339411{ fprintf (stderr , "towire_channel_send_shutdown called!\n" ); abort (); }
@@ -348,9 +420,15 @@ u8 *towire_errorfmt(const tal_t *ctx UNNEEDED,
348420 const struct channel_id * channel UNNEEDED ,
349421 const char * fmt UNNEEDED , ...)
350422{ fprintf (stderr , "towire_errorfmt called!\n" ); abort (); }
423+ /* Generated stub for towire_gossip_resolve_channel_request */
424+ u8 * towire_gossip_resolve_channel_request (const tal_t * ctx UNNEEDED , const struct short_channel_id * channel_id UNNEEDED )
425+ { fprintf (stderr , "towire_gossip_resolve_channel_request called!\n" ); abort (); }
351426/* Generated stub for towire_hsm_sign_commitment_tx */
352427u8 * towire_hsm_sign_commitment_tx (const tal_t * ctx UNNEEDED , const struct pubkey * peer_id UNNEEDED , u64 channel_dbid UNNEEDED , const struct bitcoin_tx * tx UNNEEDED , const struct pubkey * remote_funding_key UNNEEDED , u64 funding_amount UNNEEDED )
353428{ fprintf (stderr , "towire_hsm_sign_commitment_tx called!\n" ); abort (); }
429+ /* Generated stub for towire_onchain_known_preimage */
430+ u8 * towire_onchain_known_preimage (const tal_t * ctx UNNEEDED , const struct preimage * preimage UNNEEDED )
431+ { fprintf (stderr , "towire_onchain_known_preimage called!\n" ); abort (); }
354432/* Generated stub for watch_txid */
355433struct txwatch * watch_txid (const tal_t * ctx UNNEEDED ,
356434 struct chain_topology * topo UNNEEDED ,
@@ -903,10 +981,9 @@ static bool test_htlc_crud(struct lightningd *ld, const tal_t *ctx)
903981
904982 CHECK_MSG (wallet_htlcs_load_for_channel (w , chan , htlcs_in , htlcs_out ),
905983 "Failed loading HTLCs" );
906-
907- CHECK_MSG (wallet_htlcs_reconnect (w , htlcs_in , htlcs_out ),
908- "Unable to reconnect htlcs." );
909984 db_commit_transaction (w -> db );
985+
986+ htlcs_reconnect (w -> ld , htlcs_in , htlcs_out );
910987 CHECK (!wallet_err );
911988
912989 hin = htlc_in_map_get (htlcs_in , & in .key );
0 commit comments