Dash Core  0.12.2.1
P2P Digital Currency
privatesend-util.cpp
Go to the documentation of this file.
1 // Copyright (c) 2014-2017 The Dash Core developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 #include "privatesend-util.h"
5 
7  reserveKey(pwallet)
8 {
10 }
11 
13 {
15 }
16 
18 {
20 }
21 
23 {
25 }
26 
27 
29 {
30  storage.emplace_back(std::unique_ptr<CKeyHolder>(new CKeyHolder(pwallet)));
31  LogPrintf("CKeyHolderStorage::%s -- storage size %lld\n", __func__, storage.size());
32  return *storage.back();
33 }
34 
36  if (storage.size() > 0) {
37  for (auto &key : storage) {
38  key->KeepKey();
39  }
40  LogPrintf("CKeyHolderStorage::%s -- %lld keys kept\n", __func__, storage.size());
41  storage.clear();
42  }
43 }
44 
46 {
47  if (storage.size() > 0) {
48  for (auto &key : storage) {
49  key->ReturnKey();
50  }
51  LogPrintf("CKeyHolderStorage::%s -- %lld keys returned\n", __func__, storage.size());
52  storage.clear();
53  }
54 }
const CKeyHolder & AddKey(CWallet *pwalletIn)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Definition: pubkey.h:144
#define LogPrintf(...)
Definition: util.h:98
std::vector< std::unique_ptr< CKeyHolder > > storage
CScript GetScriptForDestination(const CTxDestination &dest)
Definition: standard.cpp:262
void KeepKey()
Definition: wallet.cpp:4120
CPubKey pubKey
void ReturnKey()
Definition: wallet.cpp:4129
bool GetReservedKey(CPubKey &pubkey, bool fInternalIn)
Definition: wallet.cpp:4101
CReserveKey reserveKey
CKeyHolder(CWallet *pwalletIn)
CScript GetScriptForDestination() const