Skip to content

Commit

Permalink
Merge pull request #2091 from jasonandjay/fix-addOutput
Browse files Browse the repository at this point in the history
Fix add output will mutate target
  • Loading branch information
junderw committed May 1, 2024
2 parents 3c26beb + 7e74ff2 commit 6396fb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/psbt.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class Psbt {
if (typeof address === 'string') {
const { network } = this.opts;
const script = (0, address_1.toOutputScript)(address, network);
outputData = Object.assign(outputData, { script });
outputData = Object.assign({}, outputData, { script });
}
(0, bip371_1.checkTaprootOutputFields)(outputData, outputData, 'addOutput');
const c = this.__CACHE;
Expand Down
2 changes: 1 addition & 1 deletion ts_src/psbt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export class Psbt {
if (typeof address === 'string') {
const { network } = this.opts;
const script = toOutputScript(address, network);
outputData = Object.assign(outputData, { script });
outputData = Object.assign({}, outputData, { script });
}
checkTaprootOutputFields(outputData, outputData, 'addOutput');

Expand Down

0 comments on commit 6396fb4

Please sign in to comment.