aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-07-21 13:54:13 -0400
committerJohn Newbery <john@johnnewbery.com>2017-08-04 11:08:39 -0400
commitf2123e3a7bf30545967b9ceb37961976cf7d64fb (patch)
treeb1d4d6e0091ca4a7b386b097b98e7db9cfdf5e5a /src/wallet/wallet.h
parent83f1ec33ceff1245a44a24aa8a2840e1fd43e431 (diff)
downloadbitcoin-f2123e3a7bf30545967b9ceb37961976cf7d64fb.tar.xz
[wallet] Cache keyid -> keypool id mappings
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 631cfad5b6..0d2262cfe1 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -704,6 +704,7 @@ private:
std::set<int64_t> setInternalKeyPool;
std::set<int64_t> setExternalKeyPool;
int64_t m_max_keypool_index;
+ std::map<CKeyID, int64_t> m_pool_key_to_index;
int64_t nTimeFirstKey;
@@ -973,10 +974,10 @@ public:
bool TopUpKeyPool(unsigned int kpSize = 0);
void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRequestedInternal);
void KeepKey(int64_t nIndex);
- void ReturnKey(int64_t nIndex, bool fInternal);
+ void ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey);
bool GetKeyFromPool(CPubKey &key, bool internal = false);
int64_t GetOldestKeyPoolTime();
- void GetAllReserveKeys(std::set<CKeyID>& setAddress) const;
+ const std::map<CKeyID, int64_t>& GetAllReserveKeys() const { return m_pool_key_to_index; }
std::set< std::set<CTxDestination> > GetAddressGroupings();
std::map<CTxDestination, CAmount> GetAddressBalances();