Merge #14554: qt: Remove unused adjustedTime
parameter
04972fefd1
Remove unused `adjustedTime` parameter (Hennadii Stepanov)
Pull request description:
After merging #13622 the `adjustedTime` parameter in the `updateStatus` function is unused.
Tree-SHA512: 1d0e03e7343f076ee0032fb721f8ba50571d579958001aab372a43e45b4de24c2bf3bd18c245071cbd69f61ef38182e19666c6f936d55c9085b73c848ba62626
This commit is contained in:
commit
69d574ac6c
7 changed files with 12 additions and 20 deletions
|
@ -290,8 +290,7 @@ public:
|
|||
}
|
||||
bool tryGetTxStatus(const uint256& txid,
|
||||
interfaces::WalletTxStatus& tx_status,
|
||||
int& num_blocks,
|
||||
int64_t& adjusted_time) override
|
||||
int& num_blocks) override
|
||||
{
|
||||
TRY_LOCK(::cs_main, locked_chain);
|
||||
if (!locked_chain) {
|
||||
|
@ -306,7 +305,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
num_blocks = ::chainActive.Height();
|
||||
adjusted_time = GetAdjustedTime();
|
||||
tx_status = MakeWalletTxStatus(mi->second);
|
||||
return true;
|
||||
}
|
||||
|
@ -314,14 +312,12 @@ public:
|
|||
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);
|
||||
|
|
|
@ -178,16 +178,14 @@ public:
|
|||
//! Try to get updated status for a particular transaction, if possible without blocking.
|
||||
virtual bool tryGetTxStatus(const uint256& txid,
|
||||
WalletTxStatus& tx_status,
|
||||
int& num_blocks,
|
||||
int64_t& adjusted_time) = 0;
|
||||
int& num_blocks) = 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 balances.
|
||||
virtual WalletBalances getBalances() = 0;
|
||||
|
|
|
@ -27,7 +27,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)
|
||||
{
|
||||
|
@ -53,11 +53,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;
|
||||
|
||||
|
@ -69,7 +68,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>";
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
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
|
||||
|
|
|
@ -158,7 +158,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
|
|||
return parts;
|
||||
}
|
||||
|
||||
void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t adjustedTime)
|
||||
void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks)
|
||||
{
|
||||
// Determine transaction status
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ public:
|
|||
|
||||
/** Update status from core wallet tx.
|
||||
*/
|
||||
void updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t adjustedTime);
|
||||
void updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks);
|
||||
|
||||
/** Return whether a status update is needed.
|
||||
*/
|
||||
|
|
|
@ -193,9 +193,8 @@ public:
|
|||
// simply re-use the cached status.
|
||||
interfaces::WalletTxStatus wtx;
|
||||
int numBlocks;
|
||||
int64_t adjustedTime;
|
||||
if (wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, adjustedTime) && rec->statusUpdateNeeded(numBlocks)) {
|
||||
rec->updateStatus(wtx, numBlocks, adjustedTime);
|
||||
if (wallet.tryGetTxStatus(rec->hash, wtx, numBlocks) && rec->statusUpdateNeeded(numBlocks)) {
|
||||
rec->updateStatus(wtx, numBlocks);
|
||||
}
|
||||
return rec;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue