Skip to content

Commit

Permalink
fix: only decorate psbt inputs without an existing nonWitnessUtxo
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed May 13, 2024
1 parent 76fa95e commit 80dd9da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ export function useUpdateLedgerSpecificNativeSegwitUtxoHexForAdddressIndexZero()
);

inputSigningConfig.forEach(({ index }) => {
// don't update nonWitnessUtxo if it already exists
if (tx.data.inputs.every(input => !isDefined(input.nonWitnessUtxo))) {
// decorate input with nonWitnessUtxo unless it already exists
if (!tx.data.inputs[index].nonWitnessUtxo) {
tx.updateInput(index, {
nonWitnessUtxo: Buffer.from(inputsTxHex[index], 'hex'),
});
Expand Down

0 comments on commit 80dd9da

Please sign in to comment.