mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
qt: Treat unconfirmed txs as unconfirmed
This commit is contained in:
parent
807169e10b
commit
dddd05e7a3
5 changed files with 1 additions and 36 deletions
|
@ -33,8 +33,6 @@ static const bool DEFAULT_SPLASHSCREEN = true;
|
||||||
#define COLOR_NEGATIVE QColor(255, 0, 0)
|
#define COLOR_NEGATIVE QColor(255, 0, 0)
|
||||||
/* Transaction list -- bare address (without label) */
|
/* Transaction list -- bare address (without label) */
|
||||||
#define COLOR_BAREADDRESS QColor(140, 140, 140)
|
#define COLOR_BAREADDRESS QColor(140, 140, 140)
|
||||||
/* Transaction list -- TX status decoration - open until date */
|
|
||||||
#define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255)
|
|
||||||
/* Transaction list -- TX status decoration - danger, tx needs attention */
|
/* Transaction list -- TX status decoration - danger, tx needs attention */
|
||||||
#define COLOR_TX_STATUS_DANGER QColor(200, 100, 100)
|
#define COLOR_TX_STATUS_DANGER QColor(200, 100, 100)
|
||||||
/* Transaction list -- TX status decoration - default color */
|
/* Transaction list -- TX status decoration - default color */
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include <interfaces/wallet.h>
|
#include <interfaces/wallet.h>
|
||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
#include <policy/policy.h>
|
#include <policy/policy.h>
|
||||||
#include <script/script.h>
|
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
#include <validation.h>
|
#include <validation.h>
|
||||||
#include <wallet/ismine.h>
|
#include <wallet/ismine.h>
|
||||||
|
@ -35,14 +34,6 @@ using wallet::isminetype;
|
||||||
|
|
||||||
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks)
|
QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks)
|
||||||
{
|
{
|
||||||
if (!status.is_final)
|
|
||||||
{
|
|
||||||
if (wtx.tx->nLockTime < LOCKTIME_THRESHOLD)
|
|
||||||
return tr("Open for %n more block(s)", "", wtx.tx->nLockTime - numBlocks);
|
|
||||||
else
|
|
||||||
return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.tx->nLockTime));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
int nDepth = status.depth_in_main_chain;
|
int nDepth = status.depth_in_main_chain;
|
||||||
if (nDepth < 0) {
|
if (nDepth < 0) {
|
||||||
|
|
|
@ -179,21 +179,8 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, cons
|
||||||
status.depth = wtx.depth_in_main_chain;
|
status.depth = wtx.depth_in_main_chain;
|
||||||
status.m_cur_block_hash = block_hash;
|
status.m_cur_block_hash = block_hash;
|
||||||
|
|
||||||
const bool up_to_date = ((int64_t)QDateTime::currentMSecsSinceEpoch() / 1000 - block_time < MAX_BLOCK_TIME_GAP);
|
|
||||||
if (up_to_date && !wtx.is_final) {
|
|
||||||
if (wtx.lock_time < LOCKTIME_THRESHOLD) {
|
|
||||||
status.status = TransactionStatus::OpenUntilBlock;
|
|
||||||
status.open_for = wtx.lock_time - numBlocks;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status.status = TransactionStatus::OpenUntilDate;
|
|
||||||
status.open_for = wtx.lock_time;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// For generated transactions, determine maturity
|
// For generated transactions, determine maturity
|
||||||
else if(type == TransactionRecord::Generated)
|
if (type == TransactionRecord::Generated) {
|
||||||
{
|
|
||||||
if (wtx.blocks_to_maturity > 0)
|
if (wtx.blocks_to_maturity > 0)
|
||||||
{
|
{
|
||||||
status.status = TransactionStatus::Immature;
|
status.status = TransactionStatus::Immature;
|
||||||
|
|
|
@ -30,8 +30,6 @@ public:
|
||||||
enum Status {
|
enum Status {
|
||||||
Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/
|
Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/
|
||||||
/// Normal (sent/received) transactions
|
/// Normal (sent/received) transactions
|
||||||
OpenUntilDate, /**< Transaction not yet final, waiting for date */
|
|
||||||
OpenUntilBlock, /**< Transaction not yet final, waiting for block */
|
|
||||||
Unconfirmed, /**< Not yet mined into a block **/
|
Unconfirmed, /**< Not yet mined into a block **/
|
||||||
Confirming, /**< Confirmed, but waiting for the recommended number of confirmations **/
|
Confirming, /**< Confirmed, but waiting for the recommended number of confirmations **/
|
||||||
Conflicted, /**< Conflicts with other transaction or mempool **/
|
Conflicted, /**< Conflicts with other transaction or mempool **/
|
||||||
|
|
|
@ -316,12 +316,6 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons
|
||||||
|
|
||||||
switch(wtx->status.status)
|
switch(wtx->status.status)
|
||||||
{
|
{
|
||||||
case TransactionStatus::OpenUntilBlock:
|
|
||||||
status = tr("Open for %n more block(s)","",wtx->status.open_for);
|
|
||||||
break;
|
|
||||||
case TransactionStatus::OpenUntilDate:
|
|
||||||
status = tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx->status.open_for));
|
|
||||||
break;
|
|
||||||
case TransactionStatus::Unconfirmed:
|
case TransactionStatus::Unconfirmed:
|
||||||
status = tr("Unconfirmed");
|
status = tr("Unconfirmed");
|
||||||
break;
|
break;
|
||||||
|
@ -475,9 +469,6 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx)
|
||||||
{
|
{
|
||||||
switch(wtx->status.status)
|
switch(wtx->status.status)
|
||||||
{
|
{
|
||||||
case TransactionStatus::OpenUntilBlock:
|
|
||||||
case TransactionStatus::OpenUntilDate:
|
|
||||||
return COLOR_TX_STATUS_OPENUNTILDATE;
|
|
||||||
case TransactionStatus::Unconfirmed:
|
case TransactionStatus::Unconfirmed:
|
||||||
return QIcon(":/icons/transaction_0");
|
return QIcon(":/icons/transaction_0");
|
||||||
case TransactionStatus::Abandoned:
|
case TransactionStatus::Abandoned:
|
||||||
|
|
Loading…
Add table
Reference in a new issue