Skip to content

Commit 033edb4

Browse files
authored
fix(activity): transfer amount & fees (#2112)
1 parent 3d37b47 commit 033edb4

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/utils/wallet/transfer.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,19 @@ export const getTransferForTx = async (
1414
const { currentWallet, selectedNetwork } = getCurrentWallet();
1515
const transfers = currentWallet.transfers[selectedNetwork];
1616

17-
const transfer = transfers.find((t) => {
18-
// check if the tx is a transfer to spending
19-
const isTransferToSpending = t.txId === tx.txid;
20-
if (isTransferToSpending) {
21-
return true;
22-
}
17+
// check if the tx is a transfer to spending
18+
const transferToSpending = transfers.find((t) => t.txId === tx.txid);
19+
if (transferToSpending) {
20+
return transferToSpending;
21+
}
2322

24-
// if the funding tx is in the transfer list it's a mutual close
23+
// if the funding tx is in the transfer list it's a mutual close
24+
const transferToSavings = transfers.find((t) => {
2525
const txInput = tx.vin.find((vin) => t.txId === vin.txid);
26-
if (txInput) {
27-
return true;
28-
}
26+
return !!txInput;
2927
});
30-
31-
if (transfer) {
32-
return transfer;
28+
if (transferToSavings) {
29+
return transferToSavings;
3330
}
3431

3532
// If we haven't found a transfer yet, check if the tx is a sweep from a force close

0 commit comments

Comments
 (0)