mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Remove most direct bitcoin calls from qt/walletmodel.cpp
This commit is contained in:
committed by
John Newbery
parent
90d4640b7e
commit
a0704a8996
@@ -209,7 +209,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
|
||||
if (item->text(COLUMN_TXHASH).length() == 64) // transaction hash is 64 characters (this means it is a child node, so it is not a parent node in tree mode)
|
||||
{
|
||||
copyTransactionHashAction->setEnabled(true);
|
||||
if (model->isLockedCoin(uint256S(item->text(COLUMN_TXHASH).toStdString()), item->text(COLUMN_VOUT_INDEX).toUInt()))
|
||||
if (model->wallet().isLockedCoin(COutPoint(uint256S(item->text(COLUMN_TXHASH).toStdString()), item->text(COLUMN_VOUT_INDEX).toUInt())))
|
||||
{
|
||||
lockAction->setEnabled(false);
|
||||
unlockAction->setEnabled(true);
|
||||
@@ -269,7 +269,7 @@ void CoinControlDialog::lockCoin()
|
||||
contextMenuItem->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
|
||||
|
||||
COutPoint outpt(uint256S(contextMenuItem->text(COLUMN_TXHASH).toStdString()), contextMenuItem->text(COLUMN_VOUT_INDEX).toUInt());
|
||||
model->lockCoin(outpt);
|
||||
model->wallet().lockCoin(outpt);
|
||||
contextMenuItem->setDisabled(true);
|
||||
contextMenuItem->setIcon(COLUMN_CHECKBOX, platformStyle->SingleColorIcon(":/icons/lock_closed"));
|
||||
updateLabelLocked();
|
||||
@@ -279,7 +279,7 @@ void CoinControlDialog::lockCoin()
|
||||
void CoinControlDialog::unlockCoin()
|
||||
{
|
||||
COutPoint outpt(uint256S(contextMenuItem->text(COLUMN_TXHASH).toStdString()), contextMenuItem->text(COLUMN_VOUT_INDEX).toUInt());
|
||||
model->unlockCoin(outpt);
|
||||
model->wallet().unlockCoin(outpt);
|
||||
contextMenuItem->setDisabled(false);
|
||||
contextMenuItem->setIcon(COLUMN_CHECKBOX, QIcon());
|
||||
updateLabelLocked();
|
||||
@@ -405,7 +405,7 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)
|
||||
void CoinControlDialog::updateLabelLocked()
|
||||
{
|
||||
std::vector<COutPoint> vOutpts;
|
||||
model->listLockedCoins(vOutpts);
|
||||
model->wallet().listLockedCoins(vOutpts);
|
||||
if (vOutpts.size() > 0)
|
||||
{
|
||||
ui->labelLocked->setText(tr("(%1 locked)").arg(vOutpts.size()));
|
||||
@@ -479,7 +479,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
|
||||
{
|
||||
CPubKey pubkey;
|
||||
CKeyID *keyid = boost::get<CKeyID>(&address);
|
||||
if (keyid && model->getPubKey(*keyid, pubkey))
|
||||
if (keyid && model->wallet().getPubKey(*keyid, pubkey))
|
||||
{
|
||||
nBytesInputs += (pubkey.IsCompressed() ? 148 : 180);
|
||||
}
|
||||
@@ -706,7 +706,7 @@ void CoinControlDialog::updateView()
|
||||
itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i));
|
||||
|
||||
// disable locked coins
|
||||
if (model->isLockedCoin(txhash, out.i))
|
||||
if (model->wallet().isLockedCoin(COutPoint(txhash, out.i)))
|
||||
{
|
||||
COutPoint outpt(txhash, out.i);
|
||||
coinControl()->UnSelect(outpt); // just to be sure
|
||||
|
||||
Reference in New Issue
Block a user