Skip to content

Commit

Permalink
fix(transfer): only show transfer to savings if tx has output to our …
Browse files Browse the repository at this point in the history
…wallet
  • Loading branch information
pwltr committed Mar 20, 2024
1 parent d919714 commit 0b549ce
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/utils/lightning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,17 @@ const broadcastTransaction: TBroadcastTransaction = async (

const transaction = decodeRawTx(rawTx, bitcoin.networks.regtest);

// TODO: distinguish between coop and force-close
addTransfer({
txId: transaction.txid,
type: ETransferType.coopClose,
status: ETransferStatus.pending,
amount: transaction.outputs[0].satoshi,
confirmations: 0,
});
// only show transfer if transaction has an output to our wallet
if (transaction.outputs.length > 1) {
// TODO: distinguish between coop and force-close
addTransfer({
txId: transaction.txid,
type: ETransferType.coopClose,
status: ETransferStatus.pending,
amount: transaction.outputs[0].satoshi,
confirmations: 0,
});
}

return ok(res.value);
};
Expand Down

0 comments on commit 0b549ce

Please sign in to comment.