MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_validate_lease

Function handle_validate_lease

lightningd/dual_open_control.c:2066–2102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2064}
2065
2066static void handle_validate_lease(struct subd *dualopend,
2067 const u8 *msg)
2068{
2069 const secp256k1_ecdsa_signature sig;
2070 u16 chan_fee_max_ppt;
2071 u32 chan_fee_max_base_msat, lease_expiry;
2072 struct pubkey their_pubkey;
2073 struct channel *chan;
2074 char *err_msg;
2075
2076 if (!fromwire_dualopend_validate_lease(msg,
2077 cast_const(secp256k1_ecdsa_signature *, &sig),
2078 &lease_expiry,
2079 &chan_fee_max_base_msat,
2080 &chan_fee_max_ppt,
2081 &their_pubkey)) {
2082 channel_internal_error(dualopend->channel,
2083 "Bad DUALOPEND_VALIDATE_LEASE: %s",
2084 tal_hex(tmpctx, msg));
2085 return;
2086 }
2087
2088 assert(dualopend->channel);
2089 chan = dualopend->channel;
2090
2091 if (!verify_option_will_fund_signature(chan->peer, &their_pubkey,
2092 lease_expiry,
2093 chan_fee_max_base_msat,
2094 chan_fee_max_ppt,
2095 &sig))
2096 err_msg = "Unable to verify sig";
2097 else
2098 err_msg = NULL;
2099
2100 subd_send_msg(dualopend,
2101 take(towire_dualopend_validate_lease_reply(NULL, err_msg)));
2102}
2103
2104static void handle_validate_rbf(struct subd *dualopend,
2105 const u8 *msg)

Callers 1

dual_opend_msgFunction · 0.85

Calls 4

tal_hexFunction · 0.85
channel_internal_errorFunction · 0.70
subd_send_msgFunction · 0.70

Tested by

no test coverage detected