Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions src/keystore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,6 @@ bool CBasicKeyStore::HaveWatchOnly() const
return (!setWatchOnly.empty());
}

bool CBasicKeyStore::AddMultiSig(const CScript& dest)
{
LOCK(cs_KeyStore);
setMultiSig.insert(dest);
return true;
}

bool CBasicKeyStore::RemoveMultiSig(const CScript& dest)
{
LOCK(cs_KeyStore);
setMultiSig.erase(dest);
return true;
}

bool CBasicKeyStore::HaveMultiSig(const CScript& dest) const
{
LOCK(cs_KeyStore);
return setMultiSig.count(dest) > 0;
}

bool CBasicKeyStore::HaveMultiSig() const
{
LOCK(cs_KeyStore);
return (!setMultiSig.empty());
}

bool CBasicKeyStore::HaveKey(const CKeyID& address) const
{
bool result;
Expand Down
11 changes: 0 additions & 11 deletions src/keystore.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ class CKeyStore
virtual bool RemoveWatchOnly(const CScript& dest) = 0;
virtual bool HaveWatchOnly(const CScript& dest) const = 0;
virtual bool HaveWatchOnly() const = 0;

//! Support for MultiSig addresses
virtual bool AddMultiSig(const CScript& dest) = 0;
virtual bool RemoveMultiSig(const CScript& dest) = 0;
virtual bool HaveMultiSig(const CScript& dest) const = 0;
virtual bool HaveMultiSig() const = 0;
};

typedef std::map<CKeyID, CKey> KeyMap;
Expand Down Expand Up @@ -82,11 +76,6 @@ class CBasicKeyStore : public CKeyStore
virtual bool RemoveWatchOnly(const CScript& dest);
virtual bool HaveWatchOnly(const CScript& dest) const;
virtual bool HaveWatchOnly() const;

virtual bool AddMultiSig(const CScript& dest);
virtual bool RemoveMultiSig(const CScript& dest);
virtual bool HaveMultiSig(const CScript& dest) const;
virtual bool HaveMultiSig() const;
};

typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;
Expand Down
19 changes: 1 addition & 18 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const {
}


CoinControlDialog::CoinControlDialog(QWidget* parent, bool fMultisigEnabled) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
CoinControlDialog::CoinControlDialog(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
ui(new Ui::CoinControlDialog),
model(0)
{
Expand Down Expand Up @@ -94,8 +94,6 @@ CoinControlDialog::CoinControlDialog(QWidget* parent, bool fMultisigEnabled) : Q
setCssProperty({ui->pushButtonSelectAll, ui->pushButtonToggleLock}, "btn-check");
ui->pushButtonOk->setProperty("cssClass", "btn-primary");

this->fMultisigEnabled = fMultisigEnabled;

// context menu actions
QAction* copyAddressAction = new QAction(tr("Copy address"), this);
QAction* copyLabelAction = new QAction(tr("Copy label"), this);
Expand Down Expand Up @@ -811,10 +809,6 @@ void CoinControlDialog::updateView()
int nInputSum = 0;
for(const COutput& out: coins.second) {
isminetype mine = pwalletMain->IsMine(out.tx->vout[out.i]);
bool fMultiSigUTXO = (mine & ISMINE_MULTISIG);
// when multisig is enabled, it will only display outputs from multisig addresses
if (fMultisigEnabled && !fMultiSigUTXO)
continue;
int nInputSize = 0;
nSum += out.tx->vout[out.i].nValue;
nChildren++;
Expand All @@ -827,17 +821,6 @@ void CoinControlDialog::updateView()
itemOutput->setFlags(flgCheckbox);
itemOutput->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);

//MultiSig
if (fMultiSigUTXO) {

if (!fMultisigEnabled) {
COutPoint outpt(out.tx->GetHash(), out.i);
coinControl->UnSelect(outpt); // just to be sure
itemOutput->setDisabled(true);
itemOutput->setIcon(COLUMN_CHECKBOX, QIcon(":/icons/lock_closed"));
}
}

// address
const bool fDelegated = (bool)(mine & ISMINE_SPENDABLE_DELEGATED);
CTxDestination outputAddress;
Expand Down
3 changes: 1 addition & 2 deletions src/qt/coincontroldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CoinControlDialog : public QDialog
Q_OBJECT

public:
explicit CoinControlDialog(QWidget* parent = nullptr, bool fMultisigEnabled = false);
explicit CoinControlDialog(QWidget* parent = nullptr);
~CoinControlDialog();

void setModel(WalletModel* model);
Expand All @@ -66,7 +66,6 @@ class CoinControlDialog : public QDialog
WalletModel* model;
int sortColumn;
Qt::SortOrder sortOrder;
bool fMultisigEnabled;
bool fSelectAllToggled{true}; // false when pushButtonSelectAll text is "Unselect All"

QMenu* contextMenu;
Expand Down
15 changes: 0 additions & 15 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ WalletModel::WalletModel(CWallet* wallet, OptionsModel* optionsModel, QObject* p
cachedNumBlocks(0)
{
fHaveWatchOnly = wallet->HaveWatchOnly();
fHaveMultiSig = wallet->HaveMultiSig();
fForceCheckBalanceChanged = false;

addressTableModel = new AddressTableModel(wallet, this);
Expand Down Expand Up @@ -367,12 +366,6 @@ void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly)
Q_EMIT notifyWatchonlyChanged(fHaveWatchonly);
}

void WalletModel::updateMultiSigFlag(bool fHaveMultiSig)
{
this->fHaveMultiSig = fHaveMultiSig;
Q_EMIT notifyMultiSigChanged(fHaveMultiSig);
}

bool WalletModel::getMint(const uint256& hashSerial, CZerocoinMint& mint)
{
return wallet->GetMint(hashSerial, mint);
Expand Down Expand Up @@ -845,12 +838,6 @@ static void NotifyWatchonlyChanged(WalletModel* walletmodel, bool fHaveWatchonly
Q_ARG(bool, fHaveWatchonly));
}

static void NotifyMultiSigChanged(WalletModel* walletmodel, bool fHaveMultiSig)
{
QMetaObject::invokeMethod(walletmodel, "updateMultiSigFlag", Qt::QueuedConnection,
Q_ARG(bool, fHaveMultiSig));
}

static void NotifyZerocoinChanged(WalletModel* walletmodel, CWallet* wallet, const std::string& hexString,
const std::string& isUsed, ChangeType status)
{
Expand Down Expand Up @@ -901,7 +888,6 @@ void WalletModel::subscribeToCoreSignals()
wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));
wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
wallet->NotifyWatchonlyChanged.connect(boost::bind(NotifyWatchonlyChanged, this, _1));
wallet->NotifyMultiSigChanged.connect(boost::bind(NotifyMultiSigChanged, this, _1));
wallet->NotifyZerocoinChanged.connect(boost::bind(NotifyZerocoinChanged, this, _1, _2, _3, _4));
wallet->NotifyzPIVReset.connect(boost::bind(NotifyzPIVReset, this));
wallet->NotifyWalletBacked.connect(boost::bind(NotifyWalletBacked, this, _1, _2));
Expand All @@ -915,7 +901,6 @@ void WalletModel::unsubscribeFromCoreSignals()
wallet->NotifyTransactionChanged.disconnect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));
wallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));
wallet->NotifyWatchonlyChanged.disconnect(boost::bind(NotifyWatchonlyChanged, this, _1));
wallet->NotifyMultiSigChanged.disconnect(boost::bind(NotifyMultiSigChanged, this, _1));
wallet->NotifyZerocoinChanged.disconnect(boost::bind(NotifyZerocoinChanged, this, _1, _2, _3, _4));
wallet->NotifyzPIVReset.disconnect(boost::bind(NotifyzPIVReset, this));
wallet->NotifyWalletBacked.disconnect(boost::bind(NotifyWalletBacked, this, _1, _2));
Expand Down
6 changes: 0 additions & 6 deletions src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ class WalletModel : public QObject
private:
CWallet* wallet;
bool fHaveWatchOnly;
bool fHaveMultiSig;
bool fForceCheckBalanceChanged;

// Wallet has an options model for wallet-specific options
Expand Down Expand Up @@ -370,9 +369,6 @@ class WalletModel : public QObject
// Watch-only address added
void notifyWatchonlyChanged(bool fHaveWatchonly);

// MultiSig address added
void notifyMultiSigChanged(bool fHaveMultiSig);

// Receive tab address may have changed
void notifyReceiveAddressChanged();

Expand All @@ -387,8 +383,6 @@ public Q_SLOTS:
void updateAddressBook(const QString &pubCoin, const QString &isUsed, int status);
/* Watch-only added */
void updateWatchOnlyFlag(bool fHaveWatchonly);
/* MultiSig added */
void updateMultiSigFlag(bool fHaveMultiSig);
/* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */
void pollBalanceChanged();
/* Update address book labels in the database */
Expand Down
34 changes: 2 additions & 32 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,36 +264,6 @@ bool CWallet::LoadWatchOnly(const CScript& dest)
return CCryptoKeyStore::AddWatchOnly(dest);
}

bool CWallet::AddMultiSig(const CScript& dest)
{
if (!CCryptoKeyStore::AddMultiSig(dest))
return false;
nTimeFirstKey = 1; // No birthday information
NotifyMultiSigChanged(true);
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteMultiSig(dest);
}

bool CWallet::RemoveMultiSig(const CScript& dest)
{
AssertLockHeld(cs_wallet);
if (!CCryptoKeyStore::RemoveMultiSig(dest))
return false;
if (!HaveMultiSig())
NotifyMultiSigChanged(false);
if (fFileBacked)
if (!CWalletDB(strWalletFile).EraseMultiSig(dest))
return false;

return true;
}

bool CWallet::LoadMultiSig(const CScript& dest)
{
return CCryptoKeyStore::AddMultiSig(dest);
}

bool CWallet::Unlock(const SecureString& strWalletPassphrase, bool stakingOnly)
{
CCrypter crypter;
Expand Down Expand Up @@ -2075,7 +2045,7 @@ bool CWallet::AvailableCoins(std::vector<COutput>* pCoins, // --> populates

isminetype mine = IsMine(pcoin->vout[i]);
if ( (mine == ISMINE_NO) ||
((mine == ISMINE_MULTISIG || mine == ISMINE_SPENDABLE) && nWatchonlyConfig == 2) ||
(mine == ISMINE_SPENDABLE && nWatchonlyConfig == 2) ||
(mine == ISMINE_WATCH_ONLY && nWatchonlyConfig == 1) ||
(IsLockedCoin((*it).first, i) && nCoinType != ONLY_10000) ||
(pcoin->vout[i].nValue <= 0 && !fIncludeZeroValue) ||
Expand All @@ -2092,7 +2062,7 @@ bool CWallet::AvailableCoins(std::vector<COutput>* pCoins, // --> populates

bool fIsValid = (
((mine & ISMINE_SPENDABLE) != ISMINE_NO) ||
((mine & (ISMINE_MULTISIG | (fIncludeColdStaking ? ISMINE_COLD : ISMINE_NO) |
((mine & ((fIncludeColdStaking ? ISMINE_COLD : ISMINE_NO) |
(fIncludeDelegated ? ISMINE_SPENDABLE_DELEGATED : ISMINE_NO) )) != ISMINE_NO));

// found valid coin
Expand Down
9 changes: 0 additions & 9 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,6 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
//! Adds a watch-only address to the store, without saving it to disk (used by LoadWallet)
bool LoadWatchOnly(const CScript& dest);

//! Adds a MultiSig address to the store, and saves it to disk.
bool AddMultiSig(const CScript& dest);
bool RemoveMultiSig(const CScript& dest);
//! Adds a MultiSig address to the store, without saving it to disk (used by LoadWallet)
bool LoadMultiSig(const CScript& dest);

//! Lock Wallet
bool Lock();
bool Unlock(const SecureString& strWalletPassphrase, bool anonimizeOnly = false);
Expand Down Expand Up @@ -576,9 +570,6 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
/** Watch-only address added */
boost::signals2::signal<void(bool fHaveWatchOnly)> NotifyWatchonlyChanged;

/** MultiSig address added */
boost::signals2::signal<void(bool fHaveMultiSig)> NotifyMultiSigChanged;

/** notify wallet file backed up */
boost::signals2::signal<void (const bool& fSuccess, const std::string& filename)> NotifyWalletBacked;

Expand Down
9 changes: 0 additions & 9 deletions src/wallet/wallet_ismine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,11 @@ isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest)

isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey)
{
if(keystore.HaveWatchOnly(scriptPubKey))
return ISMINE_WATCH_ONLY;
if(keystore.HaveMultiSig(scriptPubKey))
return ISMINE_MULTISIG;

std::vector<valtype> vSolutions;
txnouttype whichType;
if(!Solver(scriptPubKey, whichType, vSolutions)) {
if(keystore.HaveWatchOnly(scriptPubKey))
return ISMINE_WATCH_ONLY;
if(keystore.HaveMultiSig(scriptPubKey))
return ISMINE_MULTISIG;

return ISMINE_NO;
}
Expand Down Expand Up @@ -106,8 +99,6 @@ isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey)

if(keystore.HaveWatchOnly(scriptPubKey))
return ISMINE_WATCH_ONLY;
if(keystore.HaveMultiSig(scriptPubKey))
return ISMINE_MULTISIG;

return ISMINE_NO;
}
2 changes: 0 additions & 2 deletions src/wallet/wallet_ismine.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ enum isminetype {
ISMINE_NO = 0,
//! Indicates that we dont know how to create a scriptSig that would solve this if we were given the appropriate private keys
ISMINE_WATCH_ONLY = 1,
//! Indicates that we know how to create a scriptSig that would solve this if we were given the appropriate private keys
ISMINE_MULTISIG = 2,
ISMINE_SPENDABLE = 4,
//! Indicates that we have the staking key of a P2CS
ISMINE_COLD = 8,
Expand Down
11 changes: 0 additions & 11 deletions src/wallet/walletdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,17 +512,6 @@ bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, CW
// Watch-only addresses have no birthday information for now,
// so set the wallet birthday to the beginning of time.
pwallet->nTimeFirstKey = 1;
} else if (strType == "multisig") {
CScript script;
ssKey >> *(CScriptBase*)(&script);
char fYes;
ssValue >> fYes;
if (fYes == '1')
pwallet->LoadMultiSig(script);

// MultiSig addresses have no birthday information for now,
// so set the wallet birthday to the beginning of time.
pwallet->nTimeFirstKey = 1;
} else if (strType == "key" || strType == "wkey") {
CPubKey vchPubKey;
ssKey >> vchPubKey;
Expand Down