aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-03-13 00:44:52 -0400
committerAndrew Chow <achow101-github@achow101.com>2019-07-22 13:03:28 -0400
commit35e60e790f2cd602d1bdd0be835d27f0ba37efa9 (patch)
treeead3478f25e1b738f3441a247f1f91053dc1696f /src/wallet/walletdb.cpp
parentb3d4f6c9619142948ab3d53551b4f3c0d7d73bde (diff)
downloadbitcoin-35e60e790f2cd602d1bdd0be835d27f0ba37efa9.tar.xz
Remove ReadVersion and WriteVersion
The "version" record that these functions read and write are not used anywhere in the code except for one place. There is no reason to expose these functions publicly. Furthermore, this avoids potential confusion as developers may mistake these functions for actually reading and writing the wallet version when they do not.
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r--src/wallet/walletdb.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index 2db18bec2b..9e992b266c 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -507,7 +507,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
// Last client version to open this wallet, was previously the file version number
int last_client = CLIENT_VERSION;
- ReadVersion(last_client);
+ m_batch.Read(std::string("version"), last_client);
int wallet_version = pwallet->GetVersion();
pwallet->WalletLogPrintf("Wallet File Version = %d\n", wallet_version > 0 ? wallet_version : last_client);
@@ -527,7 +527,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
return DBErrors::NEED_REWRITE;
if (last_client < CLIENT_VERSION) // Update
- WriteVersion(CLIENT_VERSION);
+ m_batch.Write(std::string("version"), CLIENT_VERSION);
if (wss.fAnyUnordered)
result = pwallet->ReorderTransactions();
@@ -770,13 +770,3 @@ bool WalletBatch::TxnAbort()
{
return m_batch.TxnAbort();
}
-
-bool WalletBatch::ReadVersion(int& nVersion)
-{
- return m_batch.ReadVersion(nVersion);
-}
-
-bool WalletBatch::WriteVersion(int nVersion)
-{
- return m_batch.WriteVersion(nVersion);
-}