From cd5110cfbe7a120a761141777cf71c04769c4005 Mon Sep 17 00:00:00 2001 From: xiphon Date: Tue, 16 Oct 2018 18:37:48 +0000 Subject: [PATCH] tracking: don't fetch redundant txes --- pages/Receive.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pages/Receive.qml b/pages/Receive.qml index 3a249bc7..dbfa325c 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -65,6 +65,8 @@ Rectangle { } function update() { + const max_tracking = 3; + if (!appWindow.currentWallet || !trackingEnabled.checked) { trackingLineText.text = ""; trackingModel.clear(); @@ -83,7 +85,7 @@ Rectangle { var blockchainHeight = null var txs = [] - for (var i = 0; i < count; ++i) { + for (var i = 0; i < count && txs.length < max_tracking; ++i) { var idx = model.index(i, 0) var isout = model.data(idx, TransactionHistoryModel.TransactionIsOutRole); var subaddrAccount = model.data(idx, TransactionHistoryModel.TransactionSubaddrAccountRole); @@ -130,7 +132,6 @@ Rectangle { trackingLineText.text = qsTr("%1 transactions found").arg(nTransactions) + ":" + translationManager.emptyString } - var max_tracking = 3; toReceiveSatisfiedLine.text = ""; var expectedAmount = walletManager.amountFromString(amountToReceiveLine.text) if (expectedAmount && expectedAmount != amount) { @@ -143,11 +144,6 @@ Rectangle { } trackingModel.clear(); - - if (txs.length > 3) { - txs.length = 3; - } - txs.forEach(function(tx){ trackingModel.append({ "amount": tx.amount,