danicoin/src/blockchain_db
warptangent 525bf5811f
Fix estimation of batch storage size when no blocks exist
If there's no blocks in database (m_height == 0):
  Don't assign incorrect block range to check.
  Skip average block size check.

Test:

Run blockchain_converter with an existing source blockchain.bin and
a non-existent LMDB destination database.

The converter creates a BlockchainLMDB instance with zero height, due to
not being initialized with a genesis block, normally done by
Blockchain::init(). While different than the behavior of bitmonerod,
blockchain_import, and blockchain_export, the initialization hasn't been
strictly necessary.

The db batch size estimation normally uses an average block size, or a
default minimum block size, whichever is greater. In this case, as
there's no existing blocks to check for an average block size, the
default should be used.
2015-08-04 17:11:30 -07:00
..
berkeleydb ** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY) 2015-07-15 23:20:16 -07:00
lmdb Fix estimation of batch storage size when no blocks exist 2015-08-04 17:11:30 -07:00
blockchain_db.cpp ** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY) 2015-07-15 23:20:16 -07:00
blockchain_db.h ** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY) 2015-07-15 23:20:16 -07:00
CMakeLists.txt ** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY) 2015-07-15 23:20:16 -07:00
db_types.h Steps toward multiple dbs available -- working 2015-03-25 12:09:44 -04:00