Merge pull request #1861 from jgarzik/coinlock

Add new RPC "lockunspent", to prevent spending of selected outputs
This commit is contained in:
Gavin Andresen
2012-12-12 09:15:43 -08:00
5 changed files with 125 additions and 3 deletions

View File

@@ -119,11 +119,18 @@ public:
CPubKey vchDefaultKey;
std::set<COutPoint> setLockedCoins;
// check whether we are allowed to upgrade (or already support) to the named feature
bool CanSupportFeature(enum WalletFeature wf) { return nWalletMaxVersion >= wf; }
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true) const;
bool SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
bool IsLockedCoin(uint256 hash, unsigned int n) const;
void LockCoin(COutPoint& output);
void UnlockCoin(COutPoint& output);
void UnlockAllCoins();
void ListLockedCoins(std::vector<COutPoint>& vOutpts);
// keystore implementation
// Generate a new key