Skip to content

Commit 69d574a

Browse files
committed
Merge #14554: qt: Remove unused adjustedTime parameter
04972fe Remove unused `adjustedTime` parameter (Hennadii Stepanov) Pull request description: After merging #13622 the `adjustedTime` parameter in the `updateStatus` function is unused. Tree-SHA512: 1d0e03e7343f076ee0032fb721f8ba50571d579958001aab372a43e45b4de24c2bf3bd18c245071cbd69f61ef38182e19666c6f936d55c9085b73c848ba62626
2 parents 13d98ea + 04972fe commit 69d574a

File tree

7 files changed

+12
-20
lines changed

7 files changed

+12
-20
lines changed

src/interfaces/wallet.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ class WalletImpl : public Wallet
290290
}
291291
bool tryGetTxStatus(const uint256& txid,
292292
interfaces::WalletTxStatus& tx_status,
293-
int& num_blocks,
294-
int64_t& adjusted_time) override
293+
int& num_blocks) override
295294
{
296295
TRY_LOCK(::cs_main, locked_chain);
297296
if (!locked_chain) {
@@ -306,22 +305,19 @@ class WalletImpl : public Wallet
306305
return false;
307306
}
308307
num_blocks = ::chainActive.Height();
309-
adjusted_time = GetAdjustedTime();
310308
tx_status = MakeWalletTxStatus(mi->second);
311309
return true;
312310
}
313311
WalletTx getWalletTxDetails(const uint256& txid,
314312
WalletTxStatus& tx_status,
315313
WalletOrderForm& order_form,
316314
bool& in_mempool,
317-
int& num_blocks,
318-
int64_t& adjusted_time) override
315+
int& num_blocks) override
319316
{
320317
LOCK2(::cs_main, m_wallet.cs_wallet);
321318
auto mi = m_wallet.mapWallet.find(txid);
322319
if (mi != m_wallet.mapWallet.end()) {
323320
num_blocks = ::chainActive.Height();
324-
adjusted_time = GetAdjustedTime();
325321
in_mempool = mi->second.InMempool();
326322
order_form = mi->second.vOrderForm;
327323
tx_status = MakeWalletTxStatus(mi->second);

src/interfaces/wallet.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,14 @@ class Wallet
178178
//! Try to get updated status for a particular transaction, if possible without blocking.
179179
virtual bool tryGetTxStatus(const uint256& txid,
180180
WalletTxStatus& tx_status,
181-
int& num_blocks,
182-
int64_t& adjusted_time) = 0;
181+
int& num_blocks) = 0;
183182

184183
//! Get transaction details.
185184
virtual WalletTx getWalletTxDetails(const uint256& txid,
186185
WalletTxStatus& tx_status,
187186
WalletOrderForm& order_form,
188187
bool& in_mempool,
189-
int& num_blocks,
190-
int64_t& adjusted_time) = 0;
188+
int& num_blocks) = 0;
191189

192190
//! Get balances.
193191
virtual WalletBalances getBalances() = 0;

src/qt/transactiondesc.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <stdint.h>
2828
#include <string>
2929

30-
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks, int64_t adjustedTime)
30+
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks)
3131
{
3232
if (!status.is_final)
3333
{
@@ -53,11 +53,10 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const i
5353
QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit)
5454
{
5555
int numBlocks;
56-
int64_t adjustedTime;
5756
interfaces::WalletTxStatus status;
5857
interfaces::WalletOrderForm orderForm;
5958
bool inMempool;
60-
interfaces::WalletTx wtx = wallet.getWalletTxDetails(rec->hash, status, orderForm, inMempool, numBlocks, adjustedTime);
59+
interfaces::WalletTx wtx = wallet.getWalletTxDetails(rec->hash, status, orderForm, inMempool, numBlocks);
6160

6261
QString strHTML;
6362

@@ -69,7 +68,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
6968
CAmount nDebit = wtx.debit;
7069
CAmount nNet = nCredit - nDebit;
7170

72-
strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx, status, inMempool, numBlocks, adjustedTime);
71+
strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx, status, inMempool, numBlocks);
7372
strHTML += "<br>";
7473

7574
strHTML += "<b>" + tr("Date") + ":</b> " + (nTime ? GUIUtil::dateTimeStr(nTime) : "") + "<br>";

src/qt/transactiondesc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TransactionDesc: public QObject
2929
private:
3030
TransactionDesc() {}
3131

32-
static QString FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks, int64_t adjustedTime);
32+
static QString FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks);
3333
};
3434

3535
#endif // BITCOIN_QT_TRANSACTIONDESC_H

src/qt/transactionrecord.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
158158
return parts;
159159
}
160160

161-
void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t adjustedTime)
161+
void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks)
162162
{
163163
// Determine transaction status
164164

src/qt/transactionrecord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class TransactionRecord
138138

139139
/** Update status from core wallet tx.
140140
*/
141-
void updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t adjustedTime);
141+
void updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks);
142142

143143
/** Return whether a status update is needed.
144144
*/

src/qt/transactiontablemodel.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ class TransactionTablePriv
193193
// simply re-use the cached status.
194194
interfaces::WalletTxStatus wtx;
195195
int numBlocks;
196-
int64_t adjustedTime;
197-
if (wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, adjustedTime) && rec->statusUpdateNeeded(numBlocks)) {
198-
rec->updateStatus(wtx, numBlocks, adjustedTime);
196+
if (wallet.tryGetTxStatus(rec->hash, wtx, numBlocks) && rec->statusUpdateNeeded(numBlocks)) {
197+
rec->updateStatus(wtx, numBlocks);
199198
}
200199
return rec;
201200
}

0 commit comments

Comments
 (0)