aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-04-16 14:56:45 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-04-17 20:03:42 +0200
commit6b6aaa1698838278a547f16a15e635bd58ec867d (patch)
tree62a79e33a866c2a92f548cecb6148c7339f8beaf /src/db.cpp
parentccd65d426156c3d5b7a8f1123210decd1f06fe42 (diff)
Further reduce header dependencies
This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 447759f3cc..c67cf2f8a5 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -6,7 +6,6 @@
#include "db.h"
#include "util.h"
#include "main.h"
-#include "wallet.h"
#include <boost/version.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
@@ -229,8 +228,8 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
if (pcursor)
while (fSuccess)
{
- CDataStream ssKey;
- CDataStream ssValue;
+ CDataStream ssKey(SER_DISK, CLIENT_VERSION);
+ CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = db.ReadAtCursor(pcursor, ssKey, ssValue, DB_NEXT);
if (ret == DB_NOTFOUND)
{
@@ -386,10 +385,10 @@ bool CTxDB::ReadOwnerTxes(uint160 hash160, int nMinHeight, vector<CTransaction>&
loop
{
// Read next record
- CDataStream ssKey;
+ CDataStream ssKey(SER_DISK, CLIENT_VERSION);
if (fFlags == DB_SET_RANGE)
ssKey << string("owner") << hash160 << CDiskTxPos(0, 0, 0);
- CDataStream ssValue;
+ CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
fFlags = DB_NEXT;
if (ret == DB_NOTFOUND)
@@ -514,10 +513,10 @@ bool CTxDB::LoadBlockIndex()
loop
{
// Read next record
- CDataStream ssKey;
+ CDataStream ssKey(SER_DISK, CLIENT_VERSION);
if (fFlags == DB_SET_RANGE)
ssKey << make_pair(string("blockindex"), uint256(0));
- CDataStream ssValue;
+ CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
fFlags = DB_NEXT;
if (ret == DB_NOTFOUND)
@@ -754,8 +753,8 @@ bool CAddrDB::LoadAddresses()
loop
{
// Read next record
- CDataStream ssKey;
- CDataStream ssValue;
+ CDataStream ssKey(SER_DISK, CLIENT_VERSION);
+ CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue);
if (ret == DB_NOTFOUND)
break;