Skip to content

Commit

Permalink
Change new constants in txdb.h to int64_t
Browse files Browse the repository at this point in the history
A shift overflow was happening when using these to check against in init.cpp.
Fixes bitcoin#3702.
  • Loading branch information
laanwj committed Feb 18, 2014
1 parent 5c99323 commit ad54a9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void OptionsModel::Init()
#endif

if (!settings.contains("nDatabaseCache"))
settings.setValue("nDatabaseCache", nDefaultDbCache);
settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
if (!SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString()))
strOverriddenByCommandLine += "-dbcache ";

Expand Down
6 changes: 3 additions & 3 deletions src/txdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class CCoins;
class uint256;

// -dbcache default (MiB)
static const int nDefaultDbCache = 100;
static const int64_t nDefaultDbCache = 100;
// max. -dbcache in (MiB)
static const int nMaxDbCache = sizeof(void*) > 4 ? 4096 : 1024;
static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 4096 : 1024;
// min. -dbcache in (MiB)
static const int nMinDbCache = 4;
static const int64_t nMinDbCache = 4;

/** CCoinsView backed by the LevelDB coin database (chainstate/) */
class CCoinsViewDB : public CCoinsView
Expand Down

0 comments on commit ad54a9b

Please sign in to comment.