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

Function sign_tx_input

bitcoin/signature.c:161–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void sign_tx_input(const struct bitcoin_tx *tx,
162 unsigned int in,
163 const u8 *subscript,
164 const u8 *witness_script,
165 const struct privkey *privkey, const struct pubkey *key,
166 enum sighash_type sighash_type,
167 struct bitcoin_signature *sig)
168{
169 struct sha256_double hash;
170 bool use_segwit = witness_script != NULL;
171 const u8 *script = use_segwit ? witness_script : subscript;
172
173 assert(sighash_type_valid(sighash_type));
174
175 sig->sighash_type = sighash_type;
176 bitcoin_tx_hash_for_sig(tx, in, script, sighash_type, &hash);
177
178 dump_tx("Signing", tx, in, subscript, key, &hash);
179 sign_hash(privkey, &hash, &sig->s);
180}
181
182bool check_signed_hash(const struct sha256_double *hash,
183 const secp256k1_ecdsa_signature *signature,

Callers 11

handle_sign_to_us_txFunction · 0.85
report_htlcsFunction · 0.85
reportFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 4

sighash_type_validFunction · 0.85
bitcoin_tx_hash_for_sigFunction · 0.85
dump_txFunction · 0.85
sign_hashFunction · 0.85

Tested by 2

report_htlcsFunction · 0.68
reportFunction · 0.68