Skip to content

Commit

Permalink
Remove the 'weight' column from the coin control dialog. Weight is th…
Browse files Browse the repository at this point in the history
…e same as 'amount' for staking coins.
  • Loading branch information
dooglus committed Sep 11, 2015
1 parent 09472e9 commit 8a97c4b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
9 changes: 0 additions & 9 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
ui->treeWidget->setColumnWidth(COLUMN_DATE, 110);
ui->treeWidget->setColumnWidth(COLUMN_CONFIRMATIONS, 100);
ui->treeWidget->setColumnWidth(COLUMN_AGE, 60);
ui->treeWidget->setColumnWidth(COLUMN_WEIGHT, 60);
ui->treeWidget->setColumnWidth(COLUMN_PRIORITY, 100);
ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true); // store transacton hash in this column, but dont show it
ui->treeWidget->setColumnHidden(COLUMN_VOUT_INDEX, true); // store vout index in this column, but dont show it
Expand Down Expand Up @@ -627,7 +626,6 @@ void CoinControlDialog::updateView()
double dPrioritySum = 0;
int nChildren = 0;
int nInputSum = 0;
int dWeight = 0;
BOOST_FOREACH(const COutput& out, coins.second)
{
int nInputSize = 148; // 180 if uncompressed public key
Expand Down Expand Up @@ -688,12 +686,6 @@ void CoinControlDialog::updateView()
int age = floorf((GetTime() - out.tx->GetTxTime()) / (1440 * nTargetStakeSpacing));
itemOutput->setText(COLUMN_AGE, strPad(QString::number(age), 5, " "));

// weight
int weight = floorf((GetTime() - out.tx->GetTxTime()) * out.tx->vout[out.i].nValue / BitcoinUnits::factor(BitcoinUnits::BTC) / (double)(1440 * nTargetStakeSpacing));
if (weight < 0) weight = 0;
itemOutput->setText(COLUMN_WEIGHT, strPad(QString::number(weight), 5, " "));
dWeight += weight;

// priority
double dPriority = ((double)out.tx->vout[out.i].nValue / (nInputSize + 78)) * (out.nDepth+1); // 78 = 2 * 34 + 10
//itemOutput->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(dPriority));
Expand Down Expand Up @@ -730,7 +722,6 @@ void CoinControlDialog::updateView()
itemWalletAddress->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, nSum));
itemWalletAddress->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(nSum), 15, " "));
itemWalletAddress->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(dPrioritySum));
itemWalletAddress->setText(COLUMN_WEIGHT, strPad(QString::number((int64_t)dWeight), 5, " "));
}
}

Expand Down
1 change: 0 additions & 1 deletion src/qt/coincontroldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class CoinControlDialog : public QDialog
COLUMN_DATE,
COLUMN_CONFIRMATIONS,
COLUMN_AGE,
COLUMN_WEIGHT,
COLUMN_PRIORITY,
COLUMN_TXHASH,
COLUMN_VOUT_INDEX,
Expand Down
10 changes: 1 addition & 9 deletions src/qt/forms/coincontroldialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@
<string>Age in days</string>
</property>
</column>
<column>
<property name="text">
<string>Weight</string>
</property>
<property name="toolTip">
<string>Weight</string>
</property>
</column>
<column>
<property name="text">
<string>Priority</string>
Expand Down Expand Up @@ -579,7 +571,7 @@
</font>
</property>
<property name="text">
<string>Note: Age, Weight, and Priority are not taken into account during staking.</string>
<string>Note: Age and Priority are not taken into account during staking.</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit 8a97c4b

Please sign in to comment.