mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
lightningd: Added loading of HTLCs upon startup
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
b4732f6091
commit
c1493ae60c
2 changed files with 18 additions and 1 deletions
|
@ -287,8 +287,14 @@ int main(int argc, char *argv[])
|
|||
derive_peer_seed(ld, peer->seed, &peer->id, peer->channel->id);
|
||||
peer->htlcs = tal_arr(peer, struct htlc_stub, 0);
|
||||
peer->owner = NULL;
|
||||
if (!wallet_htlcs_load_for_channel(ld->wallet, peer->channel,
|
||||
&ld->htlcs_in, &ld->htlcs_out)) {
|
||||
err(1, "could not load htlcs for channel: %s", ld->wallet->db->err);
|
||||
}
|
||||
}
|
||||
if (!wallet_htlcs_reconnect(ld->wallet, &ld->htlcs_in, &ld->htlcs_out)) {
|
||||
errx(1, "could not reconnect htlcs loaded from wallet, wallet may be inconsistent.");
|
||||
}
|
||||
|
||||
/* Create RPC socket (if any) */
|
||||
setup_jsonrpc(ld, ld->rpc_filename);
|
||||
|
||||
|
|
|
@ -75,6 +75,17 @@ const char *version(void)
|
|||
/* Generated stub for wallet_channels_load_active */
|
||||
bool wallet_channels_load_active(struct wallet *w UNNEEDED, struct list_head *peers UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_channels_load_active called!\n"); abort(); }
|
||||
/* Generated stub for wallet_htlcs_load_for_channel */
|
||||
bool wallet_htlcs_load_for_channel(struct wallet *wallet UNNEEDED,
|
||||
struct wallet_channel *chan UNNEEDED,
|
||||
struct htlc_in_map *htlcs_in UNNEEDED,
|
||||
struct htlc_out_map *htlcs_out UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_htlcs_load_for_channel called!\n"); abort(); }
|
||||
/* Generated stub for wallet_htlcs_reconnect */
|
||||
bool wallet_htlcs_reconnect(struct wallet *wallet UNNEEDED,
|
||||
struct htlc_in_map *htlcs_in UNNEEDED,
|
||||
struct htlc_out_map *htlcs_out UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_htlcs_reconnect called!\n"); abort(); }
|
||||
/* Generated stub for wallet_new */
|
||||
struct wallet *wallet_new(const tal_t *ctx UNNEEDED, struct log *log UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_new called!\n"); abort(); }
|
||||
|
|
Loading…
Add table
Reference in a new issue