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

Function handle_get_output_scriptpubkey

hsmd/libhsmd.c:1140–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1138}
1139
1140static u8 *handle_get_output_scriptpubkey(struct hsmd_client *c,
1141 const u8 *msg_in)
1142{
1143 struct pubkey pubkey;
1144 struct privkey privkey;
1145 struct unilateral_close_info info;
1146 u8 *scriptPubkey;
1147
1148 info.commitment_point = NULL;
1149 if (!fromwire_hsmd_get_output_scriptpubkey(tmpctx, msg_in,
1150 &info.channel_id,
1151 &info.peer_id,
1152 &info.commitment_point))
1153 return hsmd_status_malformed_request(c, msg_in);
1154
1155 hsm_unilateral_close_privkey(&privkey, &info);
1156 pubkey_from_privkey(&privkey, &pubkey);
1157 scriptPubkey = scriptpubkey_p2wpkh(tmpctx, &pubkey);
1158
1159 return towire_hsmd_get_output_scriptpubkey_reply(NULL,
1160 scriptPubkey);
1161}
1162
1163/*~ The specific routine to sign the channel_announcement message. This is
1164 * defined in BOLT #7, and requires *two* signatures: one from this node's key

Callers 1

Calls 4

pubkey_from_privkeyFunction · 0.85
scriptpubkey_p2wpkhFunction · 0.85

Tested by

no test coverage detected