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) { | ||||
std::vector<COutPoint> vCoinControl; | std::vector<COutPoint> vCoinControl; | ||||
std::vector<COutput> vOutputs; | std::vector<COutput> vOutputs; | ||||
coinControl->ListSelected(vCoinControl); | coinControl->ListSelected(vCoinControl); | ||||
model->getOutputs(vCoinControl, vOutputs); | model->getOutputs(vCoinControl, vOutputs); | ||||
for (const COutput &out : vOutputs) { | for (const COutput &out : vOutputs) { | ||||
// unselect already spent, very unlikely scenario, this could happen | // unselect already spent, very unlikely scenario, this could happen | ||||
// when selected are spent elsewhere, like rpc or another computer | // when selected are spent elsewhere, like rpc or another computer | ||||
uint256 txhash = out.tx->GetId(); | TxHash txhash = out.tx->GetHash(); | ||||
COutPoint outpt(txhash, out.i); | COutPoint outpt(txhash, out.i); | ||||
if (model->isSpent(outpt)) { | if (model->isSpent(outpt)) { | ||||
coinControl->UnSelect(outpt); | coinControl->UnSelect(outpt); | ||||
continue; | continue; | ||||
} | } | ||||
// Quantity | // Quantity | ||||
nQuantity++; | nQuantity++; | ||||
▲ Show 20 Lines • Show All 296 Lines • ▼ Show 20 Lines | for (const std::pair<QString, std::vector<COutput>> &coins : mapCoins) { | ||||
// confirmations | // confirmations | ||||
itemOutput->setText(COLUMN_CONFIRMATIONS, | itemOutput->setText(COLUMN_CONFIRMATIONS, | ||||
QString::number(out.nDepth)); | QString::number(out.nDepth)); | ||||
itemOutput->setData(COLUMN_CONFIRMATIONS, Qt::UserRole, | itemOutput->setData(COLUMN_CONFIRMATIONS, Qt::UserRole, | ||||
QVariant((qlonglong)out.nDepth)); | QVariant((qlonglong)out.nDepth)); | ||||
// transaction hash | // transaction hash | ||||
uint256 txhash = out.tx->GetId(); | TxHash txhash = out.tx->GetHash(); | ||||
itemOutput->setText(COLUMN_TXHASH, | itemOutput->setText(COLUMN_TXHASH, | ||||
QString::fromStdString(txhash.GetHex())); | QString::fromStdString(txhash.GetHex())); | ||||
// vout index | // vout index | ||||
itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i)); | itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i)); | ||||
// disable locked coins | // disable locked coins | ||||
if (model->isLockedCoin(txhash, out.i)) { | if (model->isLockedCoin(txhash, out.i)) { | ||||
Show All 38 Lines |