Refactor: Add new ScriptPubKeyMan virtual methods

This commit does not change behavior.
This commit is contained in:
Andrew Chow
2019-10-07 14:11:34 -04:00
parent 533d8b364f
commit acedc5b823
3 changed files with 47 additions and 11 deletions

View File

@@ -148,8 +148,11 @@ public:
virtual ~ScriptPubKeyMan() {};
virtual isminetype IsMine(const CScript& script) const { return ISMINE_NO; }
//! Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo
virtual void UpgradeKeyMetadata() {}
virtual bool GetReservedDestination(const OutputType type, bool internal, int64_t& index, CKeyPool& keypool) { return false; }
virtual void KeepDestination(int64_t index) {}
virtual void ReturnDestination(int64_t index, bool internal, const CPubKey& pubkey) {}
virtual bool TopUp(unsigned int size = 0) { return false; }
/* Returns true if HD is enabled */
virtual bool IsHDEnabled() const { return false; }
@@ -247,7 +250,15 @@ public:
//! will encrypt previously unencrypted keys
bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
void UpgradeKeyMetadata() override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
bool GetReservedDestination(const OutputType type, bool internal, int64_t& index, CKeyPool& keypool) override;
void KeepDestination(int64_t index) override;
void ReturnDestination(int64_t index, bool internal, const CPubKey& pubkey) override;
bool TopUp(unsigned int size = 0) override;
//! Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo
void UpgradeKeyMetadata() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
bool IsHDEnabled() const override;