| 2510 | } |
| 2511 | |
| 2512 | static void steal_htlc(struct tracked_output *out) |
| 2513 | { |
| 2514 | const u8 *msg; |
| 2515 | u8 der[PUBKEY_CMPR_LEN]; |
| 2516 | |
| 2517 | /* BOLT #3: |
| 2518 | * |
| 2519 | * If a revoked commitment transaction is published, the remote node can |
| 2520 | * spend this output immediately with the following witness: |
| 2521 | * |
| 2522 | * <revocation_sig> <revocationpubkey> |
| 2523 | */ |
| 2524 | pubkey_to_der(der, &keyset->self_revocation_key); |
| 2525 | |
| 2526 | msg = towire_onchaind_spend_penalty(NULL, |
| 2527 | &out->outpoint, out->sat, |
| 2528 | remote_per_commitment_secret, |
| 2529 | tal_dup_arr(tmpctx, u8, der, ARRAY_SIZE(der), 0), |
| 2530 | out->wscript); |
| 2531 | |
| 2532 | /* Spend this immediately. */ |
| 2533 | propose_immediate_resolution(out, take(msg), OUR_PENALTY_TX); |
| 2534 | } |
| 2535 | |
| 2536 | /* Tell wallet that we have discovered a UTXO from a to-remote output, |
| 2537 | * which it can spend with a little additional info we give here. */ |
no test coverage detected