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

Function handle_validate_lease

lightningd/dual_open_control.c:2259–2295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2257}
2258
2259static void handle_validate_lease(struct subd *dualopend,
2260 const u8 *msg)
2261{
2262 secp256k1_ecdsa_signature sig = {{0}};
2263 u16 chan_fee_max_ppt;
2264 u32 chan_fee_max_base_msat, lease_expiry;
2265 struct pubkey their_pubkey;
2266 struct channel *chan;
2267 char *err_msg;
2268
2269 if (!fromwire_dualopend_validate_lease(msg,
2270 cast_const(secp256k1_ecdsa_signature *, &sig),
2271 &lease_expiry,
2272 &chan_fee_max_base_msat,
2273 &chan_fee_max_ppt,
2274 &their_pubkey)) {
2275 channel_internal_error(dualopend->channel,
2276 "Bad DUALOPEND_VALIDATE_LEASE: %s",
2277 tal_hex(tmpctx, msg));
2278 return;
2279 }
2280
2281 assert(dualopend->channel);
2282 chan = dualopend->channel;
2283
2284 if (!verify_option_will_fund_signature(chan->peer, &their_pubkey,
2285 lease_expiry,
2286 chan_fee_max_base_msat,
2287 chan_fee_max_ppt,
2288 &sig))
2289 err_msg = "Unable to verify sig";
2290 else
2291 err_msg = NULL;
2292
2293 subd_send_msg(dualopend,
2294 take(towire_dualopend_validate_lease_reply(NULL, err_msg)));
2295}
2296
2297static void handle_validate_rbf(struct subd *dualopend,
2298 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