Skip to content

Commit

Permalink
Fix issue with sidechain swap and max-send
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreb committed Nov 21, 2022
1 parent 1e93cc9 commit d9586c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class AccountSendSidechainConfirmComponent implements OnInit, OnDestroy {
},
];

debugger;
// Add OP_RETURN output before we calculate fee size:
if (data != null && data != '') {
var buffer = Buffer.from(data);
Expand Down
13 changes: 4 additions & 9 deletions angular/src/app/services/wallet-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,11 @@ export class WalletManager {

// We could/should also check if the output is within the threshold of dust or not.
if (totalInputAmount == totalOutputAmount) {
// Remove the "value" from the first (target address) to ensure everything is used (except fee).
targets[0].value = undefined;

// Run coinsplit instead of coinselect and remove the specified output for now.
result = coinsplit(
utxos,
[
{
address: targets[0].address,
},
],
feeRate
) as any;
result = coinsplit(utxos, targets, feeRate) as any;

// .inputs and .outputs will be undefined if no solution was found
if (!result.inputs || !result.outputs) {
Expand Down

0 comments on commit d9586c0

Please sign in to comment.