Skip to content

Commit dc4871f

Browse files
davidkaplanbitgollm-git
andcommitted
fix(utxo-lib): respect skipNonWitnessUtxo flag in PSBT
Fix condition to properly respect the skipNonWitnessUtxo flag when deciding whether to add nonWitnessUtxo to PSBTs. Issue: BTC-000 Co-authored-by: llm-git <[email protected]>
1 parent 4a0fc7e commit dc4871f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/utxo-lib/src/bitgo/wallet/Unspent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export function updateWalletUnspentForPsbt(
256256
if ((isZcashOrSegwit || customParams?.skipNonWitnessUtxo) && !input.witnessUtxo) {
257257
const { script, value } = toPrevOutput(u, psbt.network);
258258
psbt.updateInput(inputIndex, { witnessUtxo: { script, value } });
259-
} else if (!isZcashOrSegwit) {
259+
} else if (!isZcashOrSegwit && !customParams?.skipNonWitnessUtxo) {
260260
if (!isUnspentWithPrevTx(u)) {
261261
throw new Error('Error, require previous tx to add to PSBT');
262262
}

0 commit comments

Comments
 (0)