mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
wally: rename functions that clash with wally v1.0.0
Rename the offending functions from wally_foo to cln_wally_foo. For the sake of a minimal diff, only calls which conflict with wally v1.0.0 have been changed. However it is bad form to use the wally_ function namespace; the remaining such calls should also be renamed. Changelog-None Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
This commit is contained in:
parent
3cbe35e7da
commit
1f45dd1acb
@ -302,7 +302,7 @@ void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum,
|
||||
wally_psbt_output_set_amount(&tx->psbt->outputs[outnum], satoshis);
|
||||
}
|
||||
|
||||
const u8 *wally_tx_output_get_script(const tal_t *ctx,
|
||||
const u8 *cln_wally_tx_output_get_script(const tal_t *ctx,
|
||||
const struct wally_tx_output *output)
|
||||
{
|
||||
if (output->script == NULL) {
|
||||
@ -321,7 +321,7 @@ const u8 *bitcoin_tx_output_get_script(const tal_t *ctx,
|
||||
assert(outnum < tx->wtx->num_outputs);
|
||||
output = &tx->wtx->outputs[outnum];
|
||||
|
||||
return wally_tx_output_get_script(ctx, output);
|
||||
return cln_wally_tx_output_get_script(ctx, output);
|
||||
}
|
||||
|
||||
u8 *bitcoin_tx_output_get_witscript(const tal_t *ctx, const struct bitcoin_tx *tx,
|
||||
|
@ -156,7 +156,7 @@ const u8 *bitcoin_tx_output_get_script(const tal_t *ctx, const struct bitcoin_tx
|
||||
* comfort of being able to call `tal_bytelen` and similar on a script we just
|
||||
* return a `tal_arr` clone of the original script.
|
||||
*/
|
||||
const u8 *wally_tx_output_get_script(const tal_t *ctx,
|
||||
const u8 *cln_wally_tx_output_get_script(const tal_t *ctx,
|
||||
const struct wally_tx_output *output);
|
||||
/**
|
||||
* Helper to get a witness script for an output.
|
||||
|
@ -84,7 +84,7 @@ static bool is_segwit_output(const tal_t *ctx,
|
||||
if (tal_bytelen(redeemscript) > 0)
|
||||
maybe_witness = redeemscript;
|
||||
else
|
||||
maybe_witness = wally_tx_output_get_script(ctx, output);
|
||||
maybe_witness = cln_wally_tx_output_get_script(ctx, output);
|
||||
|
||||
return is_known_segwit_scripttype(maybe_witness);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ bool psbt_has_required_fields(struct wally_psbt *psbt)
|
||||
/* If is P2SH, redeemscript must be present */
|
||||
assert(psbt->inputs[i].index < input->utxo->num_outputs);
|
||||
const u8 *outscript =
|
||||
wally_tx_output_get_script(tmpctx,
|
||||
cln_wally_tx_output_get_script(tmpctx,
|
||||
&input->utxo->outputs[psbt->inputs[i].index]);
|
||||
redeem_script = wally_map_get_integer(&psbt->inputs[i].psbt_fields, /* PSBT_IN_REDEEM_SCRIPT */ 0x04);
|
||||
if (is_p2sh(outscript, NULL) && (!redeem_script || redeem_script->value_len == 0))
|
||||
|
@ -8,21 +8,21 @@
|
||||
#include <sodium.h>
|
||||
#include <wally_core.h>
|
||||
|
||||
static void *wally_tal(size_t size)
|
||||
static void *cln_wally_tal(size_t size)
|
||||
{
|
||||
assert(wally_tal_ctx);
|
||||
return tal_arr_label(wally_tal_ctx, u8, size, "wally_tal");
|
||||
return tal_arr_label(wally_tal_ctx, u8, size, "cln_wally_tal");
|
||||
}
|
||||
|
||||
static void wally_free(void *ptr)
|
||||
static void cln_wally_free(void *ptr)
|
||||
{
|
||||
tal_free(ptr);
|
||||
}
|
||||
|
||||
static struct wally_operations wally_tal_ops = {
|
||||
.struct_size = sizeof(struct wally_operations),
|
||||
.malloc_fn = wally_tal,
|
||||
.free_fn = wally_free,
|
||||
.malloc_fn = cln_wally_tal,
|
||||
.free_fn = cln_wally_free,
|
||||
};
|
||||
|
||||
static void *htable_tal(struct htable *ht, size_t len)
|
||||
|
@ -990,7 +990,7 @@ static char *check_balances(const tal_t *ctx,
|
||||
|
||||
static bool is_segwit_output(struct wally_tx_output *output)
|
||||
{
|
||||
const u8 *script = wally_tx_output_get_script(tmpctx, output);
|
||||
const u8 *script = cln_wally_tx_output_get_script(tmpctx, output);
|
||||
return is_known_segwit_scripttype(script);
|
||||
}
|
||||
|
||||
|
@ -2725,7 +2725,7 @@ int wallet_extract_owned_outputs(struct wallet *w, const struct wally_tx *wtx,
|
||||
if (!amount_asset_is_main(&asset))
|
||||
continue;
|
||||
|
||||
script = wally_tx_output_get_script(tmpctx,
|
||||
script = cln_wally_tx_output_get_script(tmpctx,
|
||||
&wtx->outputs[output]);
|
||||
if (!script)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user