diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-02-18 15:02:36 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-02-18 15:42:38 +0100 |
commit | 9976cf070fdda61afa30cd65ef5bcddad4f43e81 (patch) | |
tree | 79b6434a7ab3303a6c4fb3c03769272c0ff3a47a /src/wallet.cpp | |
parent | 0b807a417f4a15f3e37ae35e70a72e6169f01c02 (diff) |
Move GenerateNewKey back to CWallet
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 42c49aa891..da64aa5103 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -15,6 +15,16 @@ using namespace std; // mapWallet // +std::vector<unsigned char> CWallet::GenerateNewKey() +{ + RandAddSeedPerfmon(); + CKey key; + key.MakeNewKey(); + if (!AddKey(key)) + throw std::runtime_error("CWallet::GenerateNewKey() : AddKey failed"); + return key.GetPubKey(); +} + bool CWallet::AddKey(const CKey& key) { if (!CCryptoKeyStore::AddKey(key)) |