]> Git Repo - VerusCoin.git/commit - src/wallet/wallet.cpp
Refactor keytime/metadata and wallet encryption bugfix
authorPieter Wuille <[email protected]>
Wed, 19 Jun 2013 23:13:55 +0000 (01:13 +0200)
committerPieter Wuille <[email protected]>
Wed, 19 Jun 2013 23:31:18 +0000 (01:31 +0200)
commit4addb2c066e157f479fdbae902b3d568f2432fd0
treea2fbaf1a181fbac619166fcc75eb7102a172d73f
parent25dbb928600b2c65bc20ce026c5f9cf1fb457d60
Refactor keytime/metadata and wallet encryption bugfix

Refactor keytime:
* Key metadata is kept in a CWallet::mapKeyMetadata (std::map<CKeyId,CKeyMetadata>).
* When generating a new key, time is put in that map, and new key is written.
* AddKeyPubKey and AddCryptedKey do not take a creation time argument, but instead
  pull it from that map, if it exists there.

Bugfix:
* AddKeyPubKey and AddCryptedKey in CWallet didn't override the CKeyStore
  definition anymore. This is fixed, as they no longed need the nCreationTime
  argument now.

Also a few related other changes:
* Metadata can be overwritten.
* Only GenerateNewKey calls GetTime(), as it's the only place where we know for
  sure a key was not constructed earlier.
* When the nTimeFirstKey is known to be inaccurate, it is set to the value 1
  (instead of 0, which would mean unknown).
* Use CPubKey instead of std::vector<unsigned char> where possible.
src/wallet.cpp
src/wallet.h
src/walletdb.cpp
src/walletdb.h
This page took 0.024513 seconds and 4 git commands to generate.