Skip to content

Commit 04972fe

Browse files
committed
Remove unused adjustedTime parameter
qt: After merging #13622 the `adjustedTime` is not used any more in wallet related functions.
1 parent 5c25409 commit 04972fe

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
@@ -23,7 +23,7 @@
2323
#include <stdint.h>
2424
#include <string>
2525

26-
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks, int64_t adjustedTime)
26+
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks)
2727
{
2828
if (!status.is_final)
2929
{
@@ -49,11 +49,10 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const i
4949
QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit)
5050
{
5151
int numBlocks;
52-
int64_t adjustedTime;
5352
interfaces::WalletTxStatus status;
5453
interfaces::WalletOrderForm orderForm;
5554
bool inMempool;
56-
interfaces::WalletTx wtx = wallet.getWalletTxDetails(rec->hash, status, orderForm, inMempool, numBlocks, adjustedTime);
55+
interfaces::WalletTx wtx = wallet.getWalletTxDetails(rec->hash, status, orderForm, inMempool, numBlocks);
5756

5857
QString strHTML;
5958

@@ -65,7 +64,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
6564
CAmount nDebit = wtx.debit;
6665
CAmount nNet = nCredit - nDebit;
6766

68-
strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx, status, inMempool, numBlocks, adjustedTime);
67+
strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx, status, inMempool, numBlocks);
6968
strHTML += "<br>";
7069

7170
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)