mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
base58, script, protobuf_convert: don't use temporary secp256k1 context.
We use libsecp256k1 to convert signatures to DER; we were creating a temporary one, but we really should be handing the one we have in dstate through. This does that, everywhere. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -43,6 +43,7 @@ u8 *bitcoin_redeem_p2wpkh(const tal_t *ctx, const struct pubkey *key);
|
||||
|
||||
/* Create a witness which spends the 2of2. */
|
||||
void bitcoin_witness_p2sh_p2wpkh(const tal_t *ctx,
|
||||
secp256k1_context *secpctx,
|
||||
struct bitcoin_tx_input *input,
|
||||
const struct bitcoin_signature *sig,
|
||||
const struct pubkey *key);
|
||||
@@ -76,6 +77,7 @@ u8 *scriptpubkey_p2wpkh(const tal_t *ctx, const struct pubkey *key);
|
||||
|
||||
/* Create a witness which spends the 2of2. */
|
||||
u8 **bitcoin_witness_2of2(const tal_t *ctx,
|
||||
secp256k1_context *secpctx,
|
||||
const struct bitcoin_signature *sig1,
|
||||
const struct bitcoin_signature *sig2,
|
||||
const struct pubkey *key1,
|
||||
@@ -83,12 +85,14 @@ u8 **bitcoin_witness_2of2(const tal_t *ctx,
|
||||
|
||||
/* Create a witness which spends a "secret_or_delay" scriptpubkey */
|
||||
u8 **bitcoin_witness_secret(const tal_t *ctx,
|
||||
secp256k1_context *secpctx,
|
||||
const void *secret, size_t secret_len,
|
||||
const struct bitcoin_signature *sig,
|
||||
const u8 *witnessscript);
|
||||
|
||||
/* Create a witness which spends bitcoin_redeeem_htlc_recv/send */
|
||||
u8 **bitcoin_witness_htlc(const tal_t *ctx,
|
||||
secp256k1_context *secpctx,
|
||||
const void *htlc_or_revocation_preimage,
|
||||
const struct bitcoin_signature *sig,
|
||||
const u8 *witnessscript);
|
||||
|
||||
Reference in New Issue
Block a user