diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-28 13:14:45 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-28 13:14:56 +0100 |
commit | 97f2bbd7530aeaf661bd19a18039cc29c2ab6aec (patch) | |
tree | 2529ee64b7fda16f18aadfb00ce844a26346b4b9 /src/qt/transactionrecord.cpp | |
parent | 7ac375d1c20fd319feb13f0735169e2f47d4454f (diff) | |
parent | f642fd9dd6924472aba42ca324be9515690c59ad (diff) |
Merge pull request #3719
f642fd9 qt: Modernize 'confirmed' terminology in shown tx status (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/transactionrecord.cpp')
-rw-r--r-- | src/qt/transactionrecord.cpp | 59 |
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() |