X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Ftxdb-leveldb.h;h=07c708825159759952c3281a389f2ddd1dc8b993;hp=ab3f9ee6a08f348541849aaaeeb19b828976bd55;hb=27ce22da0815f4c1fa0e949cc4740e3f4dd1ea9c;hpb=adb8391acdf671640adb1e8be564e68b254fca69 diff --git a/src/txdb-leveldb.h b/src/txdb-leveldb.h index ab3f9ee..07c7088 100644 --- a/src/txdb-leveldb.h +++ b/src/txdb-leveldb.h @@ -42,11 +42,13 @@ public: private: leveldb::DB *pdb; // Points to the global instance. + // A batch stores up writes and deletes for atomic application. When this // field is non-NULL, writes/deletes go there instead of directly to disk. leveldb::WriteBatch *activeBatch; leveldb::Options options; bool fReadOnly; + int nVersion; protected: // Returns true and sets (value,false) if activeBatch contains the given key @@ -89,7 +91,7 @@ protected: SER_DISK, CLIENT_VERSION); ssValue >> value; } - catch (std::exception &e) { + catch (const std::exception&) { return false; } return true; @@ -199,23 +201,10 @@ public: bool WriteSyncCheckpoint(uint256 hashCheckpoint); bool ReadCheckpointPubKey(std::string& strPubKey); bool WriteCheckpointPubKey(const std::string& strPubKey); + bool ReadModifierUpgradeTime(unsigned int& nUpgradeTime); + bool WriteModifierUpgradeTime(const unsigned int& nUpgradeTime); bool LoadBlockIndex(); -private: - bool LoadBlockIndexGuts(); }; -// Called from the initialization code. Checks to see if there is an old -// blkindex.dat file. If so, deletes it and begins re-importing the block -// chain, which will create the new database. -enum LevelDBMigrationResult { - NONE_NEEDED, - INSUFFICIENT_DISK_SPACE, - COMPLETED, - OTHER_ERROR, -}; - -typedef boost::signals2::signal LevelDBMigrationProgress; - -LevelDBMigrationResult MaybeMigrateToLevelDB(LevelDBMigrationProgress &progress); #endif // BITCOIN_DB_H