Skip to content

Commit

Permalink
Fix issues with duplicating outputs of new txs as detached
Browse files Browse the repository at this point in the history
  • Loading branch information
Symphonic3 committed Aug 21, 2023
1 parent ed6cedc commit 568227e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,12 @@ function duplicateInputAsDetached(input) {
coin.status = Status.STATUS_COIN_DETACHED;
coin.confblock = -1;

if (coin.tx) {
let i = input.tx.outputs.indexOf(input);
coin.tx = duplicateTransaction(coin.tx);
coin.tx.outputs[i] = coin;
}

return coin;

}
Expand All @@ -1031,6 +1037,7 @@ function duplicateOutputAsNew(output) {
coin.status = Status.STATUS_NEW;
coin.txid = null;
coin.tx = null;
coin.outpoint = null;

return coin;

Expand Down

0 comments on commit 568227e

Please sign in to comment.