Skip to content

Commit 168bec0

Browse files
committed
lightningd: move channel/peer/htlc load into own function.
Also, wallet has no business wiring up HTLCs; move that code to peer_htlcs.c. Signed-off-by: Rusty Russell <[email protected]>
1 parent 3e53a63 commit 168bec0

File tree

9 files changed

+162
-87
lines changed

9 files changed

+162
-87
lines changed

lightningd/lightningd.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -366,26 +366,8 @@ int main(int argc, char *argv[])
366366
ld->ini_autocleaninvoice_cycle,
367367
ld->ini_autocleaninvoice_expiredby);
368368

369-
/* Load peers from database */
370-
if (!wallet_channels_load_active(ld, ld->wallet))
371-
fatal("Could not load channels from the database");
372-
373-
/* TODO(cdecker) Move this into common location for initialization */
374-
struct peer *peer;
375-
list_for_each(&ld->peers, peer, list) {
376-
struct channel *channel;
377-
378-
list_for_each(&peer->channels, channel, list) {
379-
if (!wallet_htlcs_load_for_channel(ld->wallet,
380-
channel,
381-
&ld->htlcs_in,
382-
&ld->htlcs_out)) {
383-
fatal("could not load htlcs for channel");
384-
}
385-
}
386-
}
387-
if (!wallet_htlcs_reconnect(ld->wallet, &ld->htlcs_in, &ld->htlcs_out))
388-
fatal("could not reconnect htlcs loaded from wallet, wallet may be inconsistent.");
369+
/* Pull peers, channels and HTLCs from db. */
370+
load_channels_from_wallet(ld);
389371

390372
/* Get the blockheight we are currently at, UINT32_MAX is used to signal
391373
* an unitialized wallet and that we should start off of bitcoind's

lightningd/peer_control.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,33 @@ void activate_peers(struct lightningd *ld)
945945
activate_peer(p);
946946
}
947947

948+
/* Pull peers, channels and HTLCs from db, and wire them up. */
949+
void load_channels_from_wallet(struct lightningd *ld)
950+
{
951+
struct peer *peer;
952+
953+
/* Load peers from database */
954+
if (!wallet_channels_load_active(ld, ld->wallet))
955+
fatal("Could not load channels from the database");
956+
957+
/* This is a poor-man's db join :( */
958+
list_for_each(&ld->peers, peer, list) {
959+
struct channel *channel;
960+
961+
list_for_each(&peer->channels, channel, list) {
962+
if (!wallet_htlcs_load_for_channel(ld->wallet,
963+
channel,
964+
&ld->htlcs_in,
965+
&ld->htlcs_out)) {
966+
fatal("could not load htlcs for channel");
967+
}
968+
}
969+
}
970+
971+
/* Now connect HTLC pointers together */
972+
htlcs_reconnect(ld, &ld->htlcs_in, &ld->htlcs_out);
973+
}
974+
948975
static void json_disconnect(struct command *cmd,
949976
const char *buffer, const jsmntok_t *params)
950977
{

lightningd/peer_control.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,7 @@ void activate_peers(struct lightningd *ld);
8989
void drop_to_chain(struct lightningd *ld, struct channel *channel, bool cooperative);
9090

9191
void channel_watch_funding(struct lightningd *ld, struct channel *channel);
92+
93+
/* Pull peers, channels and HTLCs from db, and wire them up. */
94+
void load_channels_from_wallet(struct lightningd *ld);
9295
#endif /* LIGHTNING_LIGHTNINGD_PEER_CONTROL_H */

lightningd/peer_htlcs.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,48 @@ void htlcs_notify_new_block(struct lightningd *ld, u32 height)
16711671
} while (removed);
16721672
}
16731673

1674+
/**
1675+
* htlcs_reconnect -- Link outgoing HTLCs to their origins after initial db load
1676+
*
1677+
* For each outgoing HTLC find the incoming HTLC that triggered it. If
1678+
* we are the origin of the transfer then we cannot resolve the
1679+
* incoming HTLC in which case we just leave it `NULL`.
1680+
*/
1681+
void htlcs_reconnect(struct lightningd *ld,
1682+
struct htlc_in_map *htlcs_in,
1683+
struct htlc_out_map *htlcs_out)
1684+
{
1685+
struct htlc_in_map_iter ini;
1686+
struct htlc_out_map_iter outi;
1687+
struct htlc_in *hin;
1688+
struct htlc_out *hout;
1689+
1690+
for (hout = htlc_out_map_first(htlcs_out, &outi); hout;
1691+
hout = htlc_out_map_next(htlcs_out, &outi)) {
1692+
1693+
if (hout->origin_htlc_id == 0) {
1694+
continue;
1695+
}
1696+
1697+
for (hin = htlc_in_map_first(htlcs_in, &ini); hin;
1698+
hin = htlc_in_map_next(htlcs_in, &ini)) {
1699+
if (hout->origin_htlc_id == hin->dbid) {
1700+
log_debug(ld->log,
1701+
"Found corresponding htlc_in %" PRIu64
1702+
" for htlc_out %" PRIu64,
1703+
hin->dbid, hout->dbid);
1704+
hout->in = hin;
1705+
break;
1706+
}
1707+
}
1708+
1709+
if (!hout->in)
1710+
fatal("Unable to find corresponding htlc_in %"PRIu64" for htlc_out %"PRIu64,
1711+
hout->origin_htlc_id, hout->dbid);
1712+
}
1713+
}
1714+
1715+
16741716
#if DEVELOPER
16751717
static void json_dev_ignore_htlcs(struct command *cmd, const char *buffer,
16761718
const jsmntok_t *params)

lightningd/peer_htlcs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,8 @@ void onchain_fulfilled_htlc(struct channel *channel,
6060

6161
void htlcs_notify_new_block(struct lightningd *ld, u32 height);
6262

63+
void htlcs_reconnect(struct lightningd *ld,
64+
struct htlc_in_map *htlcs_in,
65+
struct htlc_out_map *htlcs_out);
66+
6367
#endif /* LIGHTNING_LIGHTNINGD_PEER_HTLCS_H */

lightningd/test/run-find_my_path.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ void htlcs_notify_new_block(struct lightningd *ld UNNEEDED, u32 height UNNEEDED)
7171
/* Generated stub for json_escape */
7272
struct json_escaped *json_escape(const tal_t *ctx UNNEEDED, const char *str TAKES UNNEEDED)
7373
{ fprintf(stderr, "json_escape called!\n"); abort(); }
74+
/* Generated stub for load_channels_from_wallet */
75+
void load_channels_from_wallet(struct lightningd *ld UNNEEDED)
76+
{ fprintf(stderr, "load_channels_from_wallet called!\n"); abort(); }
7477
/* Generated stub for log_ */
7578
void log_(struct log *log UNNEEDED, enum log_level level UNNEEDED, const char *fmt UNNEEDED, ...)
7679

@@ -126,20 +129,6 @@ const char *version(void)
126129
/* Generated stub for wallet_blocks_heights */
127130
void wallet_blocks_heights(struct wallet *w UNNEEDED, u32 def UNNEEDED, u32 *min UNNEEDED, u32 *max UNNEEDED)
128131
{ fprintf(stderr, "wallet_blocks_heights called!\n"); abort(); }
129-
/* Generated stub for wallet_channels_load_active */
130-
bool wallet_channels_load_active(const tal_t *ctx UNNEEDED, struct wallet *w UNNEEDED)
131-
{ fprintf(stderr, "wallet_channels_load_active called!\n"); abort(); }
132-
/* Generated stub for wallet_htlcs_load_for_channel */
133-
bool wallet_htlcs_load_for_channel(struct wallet *wallet UNNEEDED,
134-
struct channel *chan UNNEEDED,
135-
struct htlc_in_map *htlcs_in UNNEEDED,
136-
struct htlc_out_map *htlcs_out UNNEEDED)
137-
{ fprintf(stderr, "wallet_htlcs_load_for_channel called!\n"); abort(); }
138-
/* Generated stub for wallet_htlcs_reconnect */
139-
bool wallet_htlcs_reconnect(struct wallet *wallet UNNEEDED,
140-
struct htlc_in_map *htlcs_in UNNEEDED,
141-
struct htlc_out_map *htlcs_out UNNEEDED)
142-
{ fprintf(stderr, "wallet_htlcs_reconnect called!\n"); abort(); }
143132
/* Generated stub for wallet_invoice_autoclean */
144133
void wallet_invoice_autoclean(struct wallet * wallet UNNEEDED,
145134
u64 cycle_seconds UNNEEDED,

wallet/test/run-wallet.c

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */
7071
void 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 */
7386
bool 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 */
7692
bool 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 */
7998
void 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 */
279301
void 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,
297319
bool 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 */
301341
void 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 */
321375
void 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 */
335389
u8 *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 */
338410
u8 *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 */
352427
u8 *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 */
355433
struct 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);

wallet/wallet.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,45 +1383,6 @@ bool wallet_htlcs_load_for_channel(struct wallet *wallet,
13831383
return ok;
13841384
}
13851385

1386-
bool wallet_htlcs_reconnect(struct wallet *wallet,
1387-
struct htlc_in_map *htlcs_in,
1388-
struct htlc_out_map *htlcs_out)
1389-
{
1390-
struct htlc_in_map_iter ini;
1391-
struct htlc_out_map_iter outi;
1392-
struct htlc_in *hin;
1393-
struct htlc_out *hout;
1394-
1395-
for (hout = htlc_out_map_first(htlcs_out, &outi); hout;
1396-
hout = htlc_out_map_next(htlcs_out, &outi)) {
1397-
1398-
if (hout->origin_htlc_id == 0) {
1399-
continue;
1400-
}
1401-
1402-
for (hin = htlc_in_map_first(htlcs_in, &ini); hin;
1403-
hin = htlc_in_map_next(htlcs_in, &ini)) {
1404-
if (hout->origin_htlc_id == hin->dbid) {
1405-
log_debug(wallet->log,
1406-
"Found corresponding htlc_in %" PRIu64
1407-
" for htlc_out %" PRIu64,
1408-
hin->dbid, hout->dbid);
1409-
hout->in = hin;
1410-
break;
1411-
}
1412-
}
1413-
1414-
if (!hout->in) {
1415-
log_broken(
1416-
wallet->log,
1417-
"Unable to find corresponding htlc_in %"PRIu64" for htlc_out %"PRIu64,
1418-
hout->origin_htlc_id, hout->dbid);
1419-
}
1420-
1421-
}
1422-
return true;
1423-
}
1424-
14251386
bool wallet_invoice_create(struct wallet *wallet,
14261387
struct invoice *pinvoice,
14271388
u64 *msatoshi TAKES,

wallet/wallet.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -480,24 +480,14 @@ void wallet_htlc_update(struct wallet *wallet, const u64 htlc_dbid,
480480
* may not have been loaded yet. In the latter case the pay_command
481481
* does not exist anymore since we restarted.
482482
*
483-
* Use `wallet_htlcs_reconnect` to wire htlc_out instances to the
483+
* Use `htlcs_reconnect` to wire htlc_out instances to the
484484
* corresponding htlc_in after loading all channels.
485485
*/
486486
bool wallet_htlcs_load_for_channel(struct wallet *wallet,
487487
struct channel *chan,
488488
struct htlc_in_map *htlcs_in,
489489
struct htlc_out_map *htlcs_out);
490490

491-
/**
492-
* wallet_htlcs_reconnect -- Link outgoing HTLCs to their origins
493-
*
494-
* For each outgoing HTLC find the incoming HTLC that triggered it. If
495-
* we are the origin of the transfer then we cannot resolve the
496-
* incoming HTLC in which case we just leave it `NULL`.
497-
*/
498-
bool wallet_htlcs_reconnect(struct wallet *wallet,
499-
struct htlc_in_map *htlcs_in,
500-
struct htlc_out_map *htlcs_out);
501491

502492
/* /!\ This is a DB ENUM, please do not change the numbering of any
503493
* already defined elements (adding is ok) /!\ */

0 commit comments

Comments
 (0)