Skip to content

Commit c91959e

Browse files
committed
Fix for wallet fee display issue
1 parent 7b2f78d commit c91959e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/CryptoNoteConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ const std::initializer_list<CheckpointData> CHECKPOINTS = {
154154
{ 156700, "c3f250d8009ac15860095835e3f3c696c470fada129cae6e0946e1cdc1d2f51a" },
155155
{ 159200, "fa120a1ef19a13c3fc629a781e37e31617c36e0b99321e3959a7e3f25ff281d3" },
156156
{ 222000, "f74f764b1f3df8ab039657f73486fcc3a91dab2018e38b5c1d7838bb6a947711" },
157+
{ 252525, "7798185c79c06fe58f04f69d7f5f0b0d2a08003fd1c9b11707b5d54d63b26832" },
157158
};
158159

159160
} // CryptoNote

src/WalletLegacy/WalletUserTransactionsCache.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ std::deque<std::unique_ptr<WalletLegacyEvent>> WalletUserTransactionsCache::onTr
279279
}
280280

281281
bool isCoinbase = txInfo.totalAmountIn == 0;
282+
uint64_t depositInterest = 0;
283+
for (const auto& spentDepositOutput : spentDepositOutputs) {
284+
depositInterest += currency.calculateInterest(spentDepositOutput.amount, spentDepositOutput.term);
285+
}
282286

283287
if (id == CryptoNote::WALLET_LEGACY_INVALID_TRANSACTION_ID) {
284288
WalletLegacyTransaction transaction;
@@ -287,7 +291,7 @@ std::deque<std::unique_ptr<WalletLegacyEvent>> WalletUserTransactionsCache::onTr
287291
transaction.firstDepositId = WALLET_LEGACY_INVALID_DEPOSIT_ID;
288292
transaction.depositCount = 0;
289293
transaction.totalAmount = txBalance;
290-
transaction.fee = isCoinbase ? 0 : txInfo.totalAmountIn - txInfo.totalAmountOut;
294+
transaction.fee = isCoinbase ? 0 : txInfo.totalAmountIn + depositInterest - txInfo.totalAmountOut;
291295
transaction.sentTime = 0;
292296
transaction.hash = txInfo.transactionHash;
293297
transaction.blockHeight = txInfo.blockHeight;

src/version.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define BUILD_COMMIT_ID "@VERSION@"
2-
#define PROJECT_VERSION "3.0.0-beta"
3-
#define PROJECT_VERSION_BUILD_NO "1733"
2+
#define PROJECT_VERSION "3.0.1-beta"
3+
#define PROJECT_VERSION_BUILD_NO "1735"
44
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"

0 commit comments

Comments
 (0)