| 2257 | } |
| 2258 | |
| 2259 | static 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 | |
| 2297 | static void handle_validate_rbf(struct subd *dualopend, |
| 2298 | const u8 *msg) |
no test coverage detected