Changeset View
Changeset View
Standalone View
Standalone View
src/qt/coincontroldialog.cpp
Show First 20 Lines • Show All 523 Lines • ▼ Show 20 Lines | for (const COutput &out : vOutputs) { | ||||
nBytesInputs += 148; | nBytesInputs += 148; | ||||
} | } | ||||
} | } | ||||
// calculation | // calculation | ||||
if (nQuantity > 0) { | if (nQuantity > 0) { | ||||
// Bytes | // Bytes | ||||
// always assume +1 output for change here | // always assume +1 output for change here | ||||
nBytes = nBytesInputs + ((CoinControlDialog::payAmounts.size() > 0 | nBytes = nBytesInputs + | ||||
((CoinControlDialog::payAmounts.size() > 0 | |||||
? CoinControlDialog::payAmounts.size() + 1 | ? CoinControlDialog::payAmounts.size() + 1 | ||||
: 2) * | : 2) * | ||||
34) + | 34) + | ||||
10; | 10; | ||||
// in the subtract fee from amount case, we can tell if zero change | // in the subtract fee from amount case, we can tell if zero change | ||||
// already and subtract the bytes, so that fee calculation afterwards is | // already and subtract the bytes, so that fee calculation afterwards is | ||||
// accurate | // accurate | ||||
if (CoinControlDialog::fSubtractFeeFromAmount) { | if (CoinControlDialog::fSubtractFeeFromAmount) { | ||||
if (nAmount - nPayAmount == Amount::zero()) { | if (nAmount - nPayAmount == Amount::zero()) { | ||||
nBytes -= 34; | nBytes -= 34; | ||||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | for (const std::pair<QString, std::vector<COutput>> &coins : mapCoins) { | ||||
if (!treeMode || (!(sAddress == sWalletAddress))) { | if (!treeMode || (!(sAddress == sWalletAddress))) { | ||||
itemOutput->setText(COLUMN_ADDRESS, sAddress); | itemOutput->setText(COLUMN_ADDRESS, sAddress); | ||||
} | } | ||||
} | } | ||||
// label | // label | ||||
if (!(sAddress == sWalletAddress)) { | if (!(sAddress == sWalletAddress)) { | ||||
// change tooltip from where the change comes from | // change tooltip from where the change comes from | ||||
itemOutput->setToolTip(COLUMN_LABEL, | itemOutput->setToolTip(COLUMN_LABEL, tr("change from %1 (%2)") | ||||
tr("change from %1 (%2)") | |||||
.arg(sWalletLabel) | .arg(sWalletLabel) | ||||
.arg(sWalletAddress)); | .arg(sWalletAddress)); | ||||
itemOutput->setText(COLUMN_LABEL, tr("(change)")); | itemOutput->setText(COLUMN_LABEL, tr("(change)")); | ||||
} else if (!treeMode) { | } else if (!treeMode) { | ||||
QString sLabel = | QString sLabel = | ||||
model->getAddressTableModel()->labelForAddress(sAddress); | model->getAddressTableModel()->labelForAddress(sAddress); | ||||
if (sLabel.isEmpty()) { | if (sLabel.isEmpty()) { | ||||
sLabel = tr("(no label)"); | sLabel = tr("(no label)"); | ||||
} | } | ||||
itemOutput->setText(COLUMN_LABEL, sLabel); | itemOutput->setText(COLUMN_LABEL, sLabel); | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |