Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bitcoin/psbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,9 @@ struct wally_psbt *psbt_from_b64(const tal_t *ctx,
size_t b64len)
{
struct wally_psbt *psbt;
char *str = tal_strndup(tmpctx, b64, b64len);

tal_wally_start();
if (wally_psbt_from_base64(str, /* flags */ 0, &psbt) == WALLY_OK)
if (wally_psbt_from_base64_n(b64, b64len, /* flags */ 0, &psbt) == WALLY_OK)
tal_add_destructor(psbt, psbt_destroy);
else
psbt = NULL;
Expand Down
2 changes: 1 addition & 1 deletion external/libwally-core
Submodule libwally-core updated 101 files
6 changes: 6 additions & 0 deletions hsmd/libhsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ static void hsm_key_for_utxo(struct privkey *privkey, struct pubkey *pubkey,
* add a partial sig for each */
static void sign_our_inputs(struct utxo **utxos, struct wally_psbt *psbt)
{
bool is_cache_enabled = false;
for (size_t i = 0; i < tal_count(utxos); i++) {
struct utxo *utxo = utxos[i];
for (size_t j = 0; j < psbt->num_inputs; j++) {
Expand Down Expand Up @@ -584,6 +585,11 @@ static void sign_our_inputs(struct utxo **utxos, struct wally_psbt *psbt)
utxo->amount);
}
tal_wally_start();
if (!is_cache_enabled) {
/* Enable caching signature sub-hashes */
wally_psbt_signing_cache_enable(psbt, 0);
is_cache_enabled = true;
}
if (wally_psbt_sign(psbt, privkey.secret.data,
sizeof(privkey.secret.data),
EC_FLAG_GRIND_R) != WALLY_OK) {
Expand Down