mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-30 03:04:21 +01:00
lightningd/gossip: clean up channel resolve failure handling.
We were getting an assert "!secp256k1_fe_is_zero(&ge->x)", because an all-zero pubkey is invalid. We allow marshal/unmarshal of NULL for now, and clean up the error handling. 1. Use status_failed if master sends a bad message. 2. Similarly, kill the gossip daemon if it gives a bad reply. 3. Use an array for returned pubkeys: 0 or 2. 4. Use type_to_string(trc, struct short_channel_id, &scid) for tracing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -99,7 +99,10 @@ void fromwire_pubkey(const u8 **cursor, size_t *max, struct pubkey *pubkey)
|
||||
if (!fromwire(cursor, max, der, sizeof(der)))
|
||||
return;
|
||||
|
||||
if (!pubkey_from_der(der, sizeof(der), pubkey))
|
||||
/* FIXME: Handing dummy keys through here is dumb.
|
||||
* See towire_gossip_resolve_channel_reply --RR */
|
||||
if (!memeqzero(der, sizeof(der))
|
||||
&& !pubkey_from_der(der, sizeof(der), pubkey))
|
||||
fail_pull(cursor, max);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user