Remove unused adjustedTime
parameter
qt: After merging #13622 the `adjustedTime` is not used any more in wallet related functions.
This commit is contained in:
parent
5c25409d68
commit
04972fefd1
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;
|
||||
|
|
|
@ -23,7 +23,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)
|
||||
{
|
||||
|
@ -49,11 +49,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;
|
||||
|
||||
|
@ -65,7 +64,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…
Reference in a new issue