diff --git a/DashSyncCurrentCommit b/DashSyncCurrentCommit index ecc56eeab..9a1806aff 100644 --- a/DashSyncCurrentCommit +++ b/DashSyncCurrentCommit @@ -1 +1 @@ -6a056858c65b46d4bc0a9c52c9d892688153799d +751595434308e0761cceb15b428a41ca5eefdb8b diff --git a/DashWallet/Sources/Categories/DSTransaction+DashWallet.swift b/DashWallet/Sources/Categories/DSTransaction+DashWallet.swift index 4a5159265..804a7edcc 100644 --- a/DashWallet/Sources/Categories/DSTransaction+DashWallet.swift +++ b/DashWallet/Sources/Categories/DSTransaction+DashWallet.swift @@ -40,7 +40,7 @@ extension DSTransaction { let direction = direction switch direction { - case .moved: + case .notAccountFunds, .moved: amount = 0 case .sent: let amountSent = chain.amountSent(by: self) @@ -54,9 +54,7 @@ extension DSTransaction { let fee = feeUsed == UInt64.max ? 0 : feeUsed amount = amountSent - amountReceived - fee case .received: - amount = account!.amountReceived(from: self) - case .notAccountFunds: - amount = 0 + amount = account?.amountReceived(from: self) ?? 0 @unknown default: fatalError() } @@ -96,7 +94,7 @@ extension DSTransaction { switch direction { case .moved, .sent, .received: - outputReceiveAddresses = account!.externalAddresses(of: self) + outputReceiveAddresses = account?.externalAddresses(of: self) ?? [] default: break } @@ -229,10 +227,10 @@ extension DSTransactionDirection { return .dw_quaternaryText() case .sent: return .dw_darkTitle() - case .received: - return .dw_dashBlue() - case .notAccountFunds: + case .received, .notAccountFunds: return .dw_dashBlue() + @unknown default: + fatalError() } } }