Add support for watch-only addresses
Changes: * Add Add/Have WatchOnly methods to CKeyStore, and implementations in CBasicKeyStore. * Add similar methods to CWallet, and support entries for it in CWalletDB. * Make IsMine in script/wallet return a new enum 'isminetype', rather than a boolean. This allows distinguishing between spendable and unspendable coins. * Add a field fSpendable to COutput (GetAvailableCoins' return type). * Mark watchonly coins in listunspent as 'watchonly': true. * Add 'watchonly' to validateaddress, suppressing script/pubkey/... in this case. Based on a patch by Eric Lombrozo. Conflicts: src/qt/walletmodel.cpp src/rpcserver.cpp src/wallet.cpp
This commit is contained in:
@@ -543,7 +543,7 @@ void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vect
|
||||
if (!wallet->mapWallet.count(outpoint.hash)) continue;
|
||||
int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain();
|
||||
if (nDepth < 0) continue;
|
||||
COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth);
|
||||
COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth, true);
|
||||
vOutputs.push_back(out);
|
||||
}
|
||||
}
|
||||
@@ -570,7 +570,7 @@ void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins)
|
||||
if (!wallet->mapWallet.count(outpoint.hash)) continue;
|
||||
int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain();
|
||||
if (nDepth < 0) continue;
|
||||
COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth);
|
||||
COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth, true);
|
||||
vCoins.push_back(out);
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins)
|
||||
while (wallet->IsChange(cout.tx->vout[cout.i]) && cout.tx->vin.size() > 0 && wallet->IsMine(cout.tx->vin[0]))
|
||||
{
|
||||
if (!wallet->mapWallet.count(cout.tx->vin[0].prevout.hash)) break;
|
||||
cout = COutput(&wallet->mapWallet[cout.tx->vin[0].prevout.hash], cout.tx->vin[0].prevout.n, 0);
|
||||
cout = COutput(&wallet->mapWallet[cout.tx->vin[0].prevout.hash], cout.tx->vin[0].prevout.n, 0, true);
|
||||
}
|
||||
|
||||
CTxDestination address;
|
||||
|
||||
Reference in New Issue
Block a user