fix fee inclusion in balance calculations
@@ -191,6 +191,8 @@ cryptoTransferGetAmountDirected (BRCryptoTransfer transfer) {
extern BRCryptoAmount
cryptoTransferGetAmountDirectedNet (BRCryptoTransfer transfer) {
BRCryptoAmount amount = cryptoTransferGetAmountDirected (transfer);
+
+ if (CRYPTO_TRANSFER_SENT == cryptoTransferGetDirection (transfer)) {
BRCryptoAmount fee = cryptoTransferGetFee (transfer);
if (NULL == fee) return amount;
@@ -201,6 +203,9 @@ cryptoTransferGetAmountDirectedNet (BRCryptoTransfer transfer) {
cryptoAmountGive (amount);
return amountNet;
+ } else {
+ return amount;
+ }
}
extern BRCryptoUnit
