mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
wallet: don't leak channel struct when peer freed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e695e5db09
commit
41a5d19198
1 changed files with 2 additions and 0 deletions
|
@ -565,6 +565,8 @@ bool wallet_channels_load_active(struct wallet *w, struct list_head *peers)
|
|||
struct wallet_channel *c = talz(w, struct wallet_channel);
|
||||
ok &= wallet_stmt2channel(w, stmt, c);
|
||||
list_add(peers, &c->peer->list);
|
||||
/* Peer owns channel. FIXME delete from db if peer freed! */
|
||||
tal_steal(c->peer, c);
|
||||
count++;
|
||||
}
|
||||
log_debug(w->log, "Loaded %d channels from DB", count);
|
||||
|
|
Loading…
Add table
Reference in a new issue