6 #ifndef PIVX_WALLET_SCRIPTPUBKEYMAN_H
7 #define PIVX_WALLET_SCRIPTPUBKEYMAN_H
14 static const unsigned int DEFAULT_KEYPOOL_SIZE = 100;
15 static const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000;
38 bool SetupGeneration(
bool newKeypool =
true,
bool force =
false,
bool memOnly =
false);
41 bool Upgrade(
const int prev_version, std::string&
error);
62 bool CanGetAddresses(
const uint8_t& type = HDChain::ChangeType::EXTERNAL);
74 void SetHDSeed(
const CPubKey& key,
bool force =
false,
bool memOnly =
false);
87 bool TopUp(
unsigned int size = 0);
An encapsulated private key.
An encapsulated public key.
Serialized script, used inside transaction inputs and outputs.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
bool TopUp(unsigned int size=0)
Fills internal address pool.
const CHDChain & GetHDChain() const
bool AddKeyPubKeyInner(const CKey &key, const CPubKey &pubkey)
CPubKey DeriveNewSeed(const CKey &key)
std::map< CKeyID, int64_t > m_pool_key_to_index
int64_t GetOldestKeyPoolTime()
std::set< int64_t > set_pre_split_keypool
bool NewKeyPool()
Key pool.
void MarkReserveKeysAsUsed(int64_t keypool_id)
Marks all keys in the keypool up to and including reserve_key as used.
void KeepDestination(int64_t index)
void SetHDSeed(const CPubKey &key, bool force=false, bool memOnly=false)
std::set< int64_t > setStakingKeyPool
void SetHDChain(CHDChain &chain, bool memonly)
void GeneratePool(WalletBatch &batch, int64_t targetSize, const uint8_t &type)
bool SetupGeneration(bool newKeypool=true, bool force=false, bool memOnly=false)
Sets up the key generation stuff, i.e.
void DeriveNewChildKey(WalletBatch &batch, CKeyMetadata &metadata, CKey &secret, const uint8_t &type=HDChain::ChangeType::EXTERNAL)
size_t KeypoolCountExternalKeys()
bool ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool, const uint8_t &type=HDChain::ChangeType::EXTERNAL)
Reserves a key from the keypool and sets nIndex to its index.
unsigned int GetKeyPoolSize() const
std::set< int64_t > setInternalKeyPool
bool CanGetAddresses(const uint8_t &type=HDChain::ChangeType::EXTERNAL)
void MarkPreSplitKeys()
Update pre HD keys in db with the pre-split flag enabled.
unsigned int GetStakingKeyPoolSize() const
const std::map< CKeyID, int64_t > & GetAllReserveKeys() const
void MarkUnusedAddresses(const CScript &script)
Mark unused addresses as being used.
void AddKeypoolPubkeyWithDB(const CPubKey &pubkey, const uint8_t &type, WalletBatch &batch)
WalletBatch * encrypted_batch
int64_t m_max_keypool_index
bool GetReservedKey(const uint8_t &changeType, int64_t &index, CKeyPool &keypool)
Reserve + fetch a key from the keypool.
void ReturnDestination(int64_t index, const uint8_t &type, const CTxDestination &)
bool GetKeyFromPool(CPubKey &key, const uint8_t &changeType=HDChain::ChangeType::EXTERNAL)
Fetches a key from the keypool.
ScriptPubKeyMan(CWallet *parent)
CPubKey GenerateNewSeed()
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)
Load a keypool entry.
bool Upgrade(const int prev_version, std::string &error)
Upgrades the wallet to the specified version.
void UpdateTimeFirstKey(int64_t nCreateTime)
First wallet key time.
std::set< int64_t > setExternalKeyPool
bool AddKeyPubKeyWithDB(WalletBatch &batch, const CKey &key, const CPubKey &pubkey)
Adds a key to the store, and saves it to disk.
std::map< int64_t, CKeyID > m_index_to_reserved_key
CPubKey GenerateNewKey(WalletBatch &batch, const uint8_t &type=HDChain::ChangeType::EXTERNAL)
Generate a new key.
Access to the wallet database.
boost::variant< CNoDestination, CKeyID, CScriptID, CExchangeKeyID > CTxDestination
A txout script template with a specific destination.
bool error(const char *fmt, const Args &... args)