Changeset View
Changeset View
Standalone View
Standalone View
src/qt/coincontroldialog.cpp
Show First 20 Lines • Show All 476 Lines • ▼ Show 20 Lines | void CoinControlDialog::updateLabels(WalletModel *model, QDialog *dialog) { | ||||
Amount nAmount = Amount::zero(); | Amount nAmount = Amount::zero(); | ||||
Amount nPayFee = Amount::zero(); | Amount nPayFee = Amount::zero(); | ||||
Amount nAfterFee = Amount::zero(); | Amount nAfterFee = Amount::zero(); | ||||
Amount nChange = Amount::zero(); | Amount nChange = Amount::zero(); | ||||
unsigned int nBytes = 0; | unsigned int nBytes = 0; | ||||
unsigned int nBytesInputs = 0; | unsigned int nBytesInputs = 0; | ||||
unsigned int nQuantity = 0; | unsigned int nQuantity = 0; | ||||
int nQuantityUncompressed = 0; | |||||
std::vector<COutPoint> vCoinControl; | std::vector<COutPoint> vCoinControl; | ||||
coinControl()->ListSelected(vCoinControl); | coinControl()->ListSelected(vCoinControl); | ||||
size_t i = 0; | size_t i = 0; | ||||
for (const auto &out : model->wallet().getCoins(vCoinControl)) { | for (const auto &out : model->wallet().getCoins(vCoinControl)) { | ||||
if (out.depth_in_main_chain < 0) { | if (out.depth_in_main_chain < 0) { | ||||
continue; | continue; | ||||
Show All 15 Lines | for (const auto &out : model->wallet().getCoins(vCoinControl)) { | ||||
// Bytes | // Bytes | ||||
CTxDestination address; | CTxDestination address; | ||||
if (ExtractDestination(out.txout.scriptPubKey, address)) { | if (ExtractDestination(out.txout.scriptPubKey, address)) { | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
CKeyID *keyid = boost::get<CKeyID>(&address); | CKeyID *keyid = boost::get<CKeyID>(&address); | ||||
if (keyid && model->wallet().getPubKey(*keyid, pubkey)) { | if (keyid && model->wallet().getPubKey(*keyid, pubkey)) { | ||||
nBytesInputs += (pubkey.IsCompressed() ? 148 : 180); | nBytesInputs += (pubkey.IsCompressed() ? 148 : 180); | ||||
if (!pubkey.IsCompressed()) { | |||||
nQuantityUncompressed++; | |||||
} | |||||
} else { | } else { | ||||
// in all error cases, simply assume 148 here | // in all error cases, simply assume 148 here | ||||
nBytesInputs += 148; | nBytesInputs += 148; | ||||
} | } | ||||
} else { | } else { | ||||
nBytesInputs += 148; | nBytesInputs += 148; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 312 Lines • Show Last 20 Lines |