diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2019-07-27 22:45:06 +1200 |
---|---|---|
committer | MeshCollider <dobsonsa68@gmail.com> | 2019-07-27 22:45:31 +1200 |
commit | febf3a856bcfb8fef2cb4ddcb8d1e0cab8a22580 (patch) | |
tree | 5dedf85ac93cf080b0c3191545b9210b8bcf07a5 /src/wallet/db.h | |
parent | 1139e3cb76202d484cf31ed6889b3a01c72cdfdd (diff) | |
parent | 35e60e790f2cd602d1bdd0be835d27f0ba37efa9 (diff) |
Merge #15588: Log the actual wallet file version and no longer publicly expose the "version" record
35e60e790f2cd602d1bdd0be835d27f0ba37efa9 Remove ReadVersion and WriteVersion (Andrew Chow)
b3d4f6c9619142948ab3d53551b4f3c0d7d73bde Log the actual wallet file version (Andrew Chow)
c88e87c3b2be3f97b712107e04285d06dfef3878 Remove nFileVersion from CWalletScanState (Andrew Chow)
Pull request description:
The wallet file version is stored in the "minversion" record, not the "version" record. However "version" is no longer used anywhere except to record the highest versioned client which has opened a wallet file (which is currently only used to check whether this was most recently opened by a 0.4.0 or 0.5.0rc1 client which had a broken wallet encryption implementation). Furthermore, "version" was logged to the debug.log which is confusing because it is not the actual wallet file version.
This PR changes it so that this confusion largely no longer exists. The wallet file version logging is changed to use "minversion" and reading and writing the "version" record is no longer publicly exposed to prevent potential confusion about whether the actual file version is being read or written. Lastly, in the one place it is actually used, the variable name is changed from nFileVersion to last_client to better reflect what that record actually represents.
ACKs for top commit:
jb55:
ACK 35e60e7, I compiled locally as a quick sanity check.
ryanofsky:
utACK 35e60e790f2cd602d1bdd0be835d27f0ba37efa9. This code still pretty confusing, but a little simpler now. And the previous log statement was really misleading and useless compared to the new one here.
meshcollider:
Looks good, thanks! utACK 35e60e790f2cd602d1bdd0be835d27f0ba37efa9
Tree-SHA512: f782b2f215d07fbc9b806322bda8085445b81c02b65ca674a8c6a3e1de505a0abd050669afe0ead4778816144a1c18462e13930071cedb7227a058aeb39493f7
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r-- | src/wallet/db.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index b3856fbaf9..94f41eaf16 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -399,17 +399,6 @@ public: return (ret == 0); } - bool ReadVersion(int& nVersion) - { - nVersion = 0; - return Read(std::string("version"), nVersion); - } - - bool WriteVersion(int nVersion) - { - return Write(std::string("version"), nVersion); - } - bool static Rewrite(BerkeleyDatabase& database, const char* pszSkip = nullptr); }; |