Skip to content

Commit 9d4fdcd

Browse files
committed
fix: use witness without annex for o.signature
1 parent 4fd164e commit 9d4fdcd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/payments/p2tr.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ function p2tr(a, opts) {
139139
});
140140
lazy.prop(o, 'signature', () => {
141141
if (a.signature) return a.signature;
142-
if (!a.witness || a.witness.length !== 1) return;
143-
return a.witness[0];
142+
const witness = _witness(); // witness without annex
143+
if (!witness || witness.length !== 1) return;
144+
return witness[0];
144145
});
145146
lazy.prop(o, 'witness', () => {
146147
if (a.witness) return a.witness;

ts_src/payments/p2tr.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ export function p2tr(a: Payment, opts?: PaymentOpts): Payment {
149149
});
150150
lazy.prop(o, 'signature', () => {
151151
if (a.signature) return a.signature;
152-
if (!a.witness || a.witness.length !== 1) return;
153-
return a.witness[0];
152+
const witness = _witness(); // witness without annex
153+
if (!witness || witness.length !== 1) return;
154+
return witness[0];
154155
});
155156

156157
lazy.prop(o, 'witness', () => {

0 commit comments

Comments
 (0)