| 814 | } |
| 815 | |
| 816 | static u8 *handle_get_output_scriptpubkey(struct hsmd_client *c, |
| 817 | const u8 *msg_in) |
| 818 | { |
| 819 | struct pubkey pubkey; |
| 820 | struct privkey privkey; |
| 821 | struct unilateral_close_info info; |
| 822 | u8 *scriptPubkey; |
| 823 | |
| 824 | info.commitment_point = NULL; |
| 825 | if (!fromwire_hsmd_get_output_scriptpubkey(tmpctx, msg_in, |
| 826 | &info.channel_id, |
| 827 | &info.peer_id, |
| 828 | &info.commitment_point)) |
| 829 | return hsmd_status_malformed_request(c, msg_in); |
| 830 | |
| 831 | hsm_unilateral_close_privkey(&privkey, &info); |
| 832 | pubkey_from_privkey(&privkey, &pubkey); |
| 833 | scriptPubkey = scriptpubkey_p2wpkh(tmpctx, &pubkey); |
| 834 | |
| 835 | return towire_hsmd_get_output_scriptpubkey_reply(NULL, |
| 836 | scriptPubkey); |
| 837 | } |
| 838 | |
| 839 | /*~ The specific routine to sign the channel_announcement message. This is |
| 840 | * defined in BOLT #7, and requires *two* signatures: one from this node's key |
no test coverage detected