fix market history

This commit is contained in:
Daniel Larimer 2015-10-09 16:31:40 -04:00
parent b3e9874ece
commit f7c91be622
4 changed files with 7 additions and 6 deletions

View file

@ -346,7 +346,9 @@ namespace graphene { namespace app {
while( itr != by_key_idx.end() && itr->key.open <= end && result.size() < 100 )
{
if( !(itr->key.base == a && itr->key.quote == b && itr->key.seconds == bucket_seconds) )
{
return result;
}
result.push_back(*itr);
++itr;
}

View file

@ -387,8 +387,6 @@ namespace detail {
virtual bool handle_block(const graphene::net::block_message& blk_msg, bool sync_mode,
std::vector<fc::uint160_t>& contained_transaction_message_ids) override
{ try {
if( !_chain_db->is_open() )
return false;
auto latency = graphene::time::now() - blk_msg.block.timestamp;
if (!sync_mode || blk_msg.block.block_num() % 10000 == 0)

View file

@ -78,19 +78,20 @@ void object_database::flush()
void object_database::wipe(const fc::path& data_dir)
{
close();
ilog("Wiping object_database.");
ilog("Wiping object database...");
fc::remove_all(data_dir / "object_database");
assert(!fc::exists(data_dir / "object_database"));
ilog("Done wiping object databse.");
}
void object_database::open(const fc::path& data_dir)
{ try {
// ilog("Open object_database in ${d}", ("d", data_dir));
ilog("Opening object database from ${d} ...", ("d", data_dir));
_data_dir = data_dir;
for( uint32_t space = 0; space < _index.size(); ++space )
for( uint32_t type = 0; type < _index[space].size(); ++type )
if( _index[space][type] )
_index[space][type]->open( _data_dir / "object_database" / fc::to_string(space)/fc::to_string(type) );
ilog( "Done opening object database." );
} FC_CAPTURE_AND_RETHROW( (data_dir) ) }

View file

@ -52,7 +52,7 @@ struct bucket_key
friend bool operator < ( const bucket_key& a, const bucket_key& b )
{
return std::tie( a.base, a.quote, b.seconds, a.open ) < std::tie( b.base, b.quote, b.seconds, b.open );
return std::tie( a.base, a.quote, a.seconds, a.open ) < std::tie( b.base, b.quote, b.seconds, b.open );
}
friend bool operator == ( const bucket_key& a, const bucket_key& b )
{