We're going to want to use this for inter-daemon comms, so generalize it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
If I'd known how large this patch would be (though trivial), I'd have done it in parts. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Including tests! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>