Skip to content

Commit

Permalink
Merge bitcoin#14554: qt: Remove unused adjustedTime parameter
Browse files Browse the repository at this point in the history
04972fe Remove unused `adjustedTime` parameter (Hennadii Stepanov)

Pull request description:

  After merging bitcoin#13622 the `adjustedTime` parameter in the `updateStatus` function is unused.

Tree-SHA512: 1d0e03e7343f076ee0032fb721f8ba50571d579958001aab372a43e45b4de24c2bf3bd18c245071cbd69f61ef38182e19666c6f936d55c9085b73c848ba62626

# Conflicts:
#	src/interfaces/wallet.cpp
#	src/interfaces/wallet.h
#	src/qt/transactionrecord.cpp
#	src/qt/transactionrecord.h
#	src/qt/transactiontablemodel.cpp
  • Loading branch information
laanwj authored and Munkybooty committed Jul 26, 2021
1 parent d13e3bf commit b31b607
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 20 deletions.
8 changes: 2 additions & 6 deletions src/interfaces/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ class WalletImpl : public Wallet
return result;
}
bool tryGetTxStatus(const uint256& txid,
interfaces::WalletTxStatus& tx_status,
int64_t& adjusted_time) override
interfaces::WalletTxStatus& tx_status) override
{
TRY_LOCK(::cs_main, locked_chain);
if (!locked_chain) {
Expand All @@ -357,22 +356,19 @@ class WalletImpl : public Wallet
if (mi == m_wallet.mapWallet.end()) {
return false;
}
adjusted_time = GetAdjustedTime();
tx_status = MakeWalletTxStatus(mi->second);
return true;
}
WalletTx getWalletTxDetails(const uint256& txid,
WalletTxStatus& tx_status,
WalletOrderForm& order_form,
bool& in_mempool,
int& num_blocks,
int64_t& adjusted_time) override
int& num_blocks) override
{
LOCK2(::cs_main, m_wallet.cs_wallet);
auto mi = m_wallet.mapWallet.find(txid);
if (mi != m_wallet.mapWallet.end()) {
num_blocks = ::chainActive.Height();
adjusted_time = GetAdjustedTime();
in_mempool = mi->second.InMempool();
order_form = mi->second.vOrderForm;
tx_status = MakeWalletTxStatus(mi->second);
Expand Down
6 changes: 2 additions & 4 deletions src/interfaces/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,14 @@ class Wallet

//! Try to get updated status for a particular transaction, if possible without blocking.
virtual bool tryGetTxStatus(const uint256& txid,
WalletTxStatus& tx_status,
int64_t& adjusted_time) = 0;
WalletTxStatus& tx_status) = 0;

//! Get transaction details.
virtual WalletTx getWalletTxDetails(const uint256& txid,
WalletTxStatus& tx_status,
WalletOrderForm& order_form,
bool& in_mempool,
int& num_blocks,
int64_t& adjusted_time) = 0;
int& num_blocks) = 0;

// Get the number of coinjoin rounds an output went through
virtual int getRealOutpointCoinJoinRounds(const COutPoint& outpoint) = 0;
Expand Down
7 changes: 3 additions & 4 deletions src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdint.h>
#include <string>

QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks, int64_t adjustedTime)
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks)
{
if (!status.is_final)
{
Expand Down Expand Up @@ -61,11 +61,10 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const i
QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit)
{
int numBlocks;
int64_t adjustedTime;
interfaces::WalletTxStatus status;
interfaces::WalletOrderForm orderForm;
bool inMempool;
interfaces::WalletTx wtx = wallet.getWalletTxDetails(rec->hash, status, orderForm, inMempool, numBlocks, adjustedTime);
interfaces::WalletTx wtx = wallet.getWalletTxDetails(rec->hash, status, orderForm, inMempool, numBlocks);

QString strHTML;

Expand All @@ -77,7 +76,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
CAmount nDebit = wtx.debit;
CAmount nNet = nCredit - nDebit;

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

strHTML += "<b>" + tr("Date") + ":</b> " + (nTime ? GUIUtil::dateTimeStr(nTime) : "") + "<br>";
Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactiondesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TransactionDesc: public QObject
private:
TransactionDesc() {}

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

#endif // BITCOIN_QT_TRANSACTIONDESC_H
2 changes: 1 addition & 1 deletion src/qt/transactionrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(interfaces::Wal
return parts;
}

void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t adjustedTime, int chainLockHeight)
void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int chainLockHeight)
{
// Determine transaction status

Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactionrecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class TransactionRecord

/** Update status from core wallet tx.
*/
void updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t adjustedTime, int chainLockHeight);
void updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int chainLockHeight);

/** Return whether a status update is needed.
*/
Expand Down
5 changes: 2 additions & 3 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ class TransactionTablePriv
// try to update the status of this transaction from the wallet.
// Otherwise, simply re-use the cached status.
interfaces::WalletTxStatus wtx;
int64_t adjustedTime;
if (rec->statusUpdateNeeded(numBlocks, parent->getChainLockHeight()) && wallet.tryGetTxStatus(rec->hash, wtx, adjustedTime)) {
rec->updateStatus(wtx, numBlocks, adjustedTime, parent->getChainLockHeight());
if (rec->statusUpdateNeeded(numBlocks, parent->getChainLockHeight()) && wallet.tryGetTxStatus(rec->hash, wtx)) {
rec->updateStatus(wtx, numBlocks, parent->getChainLockHeight());
}
return rec;
}
Expand Down

0 comments on commit b31b607

Please sign in to comment.