aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionrecord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/transactionrecord.cpp')
-rw-r--r--src/qt/transactionrecord.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 8cfaed27c7..703a2b4e79 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -164,7 +164,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
(wtx.IsCoinBase() ? 1 : 0),
wtx.nTimeReceived,
idx);
- status.confirmed = wtx.IsTrusted();
+ status.countsForBalance = wtx.IsTrusted() && !(wtx.GetBlocksToMaturity() > 0);
status.depth = wtx.GetDepthInMainChain();
status.cur_num_blocks = chainActive.Height();
@@ -181,33 +181,12 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
status.open_for = wtx.nLockTime;
}
}
- else
- {
- if (status.depth < 0)
- {
- status.status = TransactionStatus::Conflicted;
- }
- else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
- {
- status.status = TransactionStatus::Offline;
- }
- else if (status.depth < NumConfirmations)
- {
- status.status = TransactionStatus::Unconfirmed;
- }
- else
- {
- status.status = TransactionStatus::HaveConfirmations;
- }
- }
-
// For generated transactions, determine maturity
- if(type == TransactionRecord::Generated)
+ else if(type == TransactionRecord::Generated)
{
- int64_t nCredit = wtx.GetCredit(true);
- if (nCredit == 0)
+ if (wtx.GetBlocksToMaturity() > 0)
{
- status.maturity = TransactionStatus::Immature;
+ status.status = TransactionStatus::Immature;
if (wtx.IsInMainChain())
{
@@ -215,18 +194,42 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
// Check if the block was requested by anyone
if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
- status.maturity = TransactionStatus::MaturesWarning;
+ status.status = TransactionStatus::MaturesWarning;
}
else
{
- status.maturity = TransactionStatus::NotAccepted;
+ status.status = TransactionStatus::NotAccepted;
}
}
else
{
- status.maturity = TransactionStatus::Mature;
+ status.status = TransactionStatus::Confirmed;
+ }
+ }
+ else
+ {
+ if (status.depth < 0)
+ {
+ status.status = TransactionStatus::Conflicted;
+ }
+ else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
+ {
+ status.status = TransactionStatus::Offline;
+ }
+ else if (status.depth == 0)
+ {
+ status.status = TransactionStatus::Unconfirmed;
+ }
+ else if (status.depth < RecommendedNumConfirmations)
+ {
+ status.status = TransactionStatus::Confirming;
+ }
+ else
+ {
+ status.status = TransactionStatus::Confirmed;
}
}
+
}
bool TransactionRecord::statusUpdateNeeded()