File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments