mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
lightningd/subd: add a context to requests.
If a peer dies, and then we get a reply, that can cause access after free. The usual way to handle this is to make the request a child of the peer, but in fact we still want to catch (and disard) it, so it's a little more complex internally. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -97,7 +97,7 @@ void hsm_init(struct lightningd *ld, bool newdir)
|
||||
else
|
||||
create = (access("hsm_secret", F_OK) != 0);
|
||||
|
||||
subd_req(ld->hsm, take(towire_hsmctl_init(ld->hsm, create)),
|
||||
subd_req(ld->hsm, ld->hsm, take(towire_hsmctl_init(ld->hsm, create)),
|
||||
-1, 0, hsm_init_done, ld);
|
||||
|
||||
if (io_loop(NULL, NULL) != ld->hsm)
|
||||
|
||||
Reference in New Issue
Block a user