fix market history
This commit is contained in:
parent
b3e9874ece
commit
f7c91be622
4 changed files with 7 additions and 6 deletions
|
|
@ -346,7 +346,9 @@ namespace graphene { namespace app {
|
||||||
while( itr != by_key_idx.end() && itr->key.open <= end && result.size() < 100 )
|
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) )
|
if( !(itr->key.base == a && itr->key.quote == b && itr->key.seconds == bucket_seconds) )
|
||||||
|
{
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
result.push_back(*itr);
|
result.push_back(*itr);
|
||||||
++itr;
|
++itr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -387,8 +387,6 @@ namespace detail {
|
||||||
virtual bool handle_block(const graphene::net::block_message& blk_msg, bool sync_mode,
|
virtual bool handle_block(const graphene::net::block_message& blk_msg, bool sync_mode,
|
||||||
std::vector<fc::uint160_t>& contained_transaction_message_ids) override
|
std::vector<fc::uint160_t>& contained_transaction_message_ids) override
|
||||||
{ try {
|
{ try {
|
||||||
if( !_chain_db->is_open() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto latency = graphene::time::now() - blk_msg.block.timestamp;
|
auto latency = graphene::time::now() - blk_msg.block.timestamp;
|
||||||
if (!sync_mode || blk_msg.block.block_num() % 10000 == 0)
|
if (!sync_mode || blk_msg.block.block_num() % 10000 == 0)
|
||||||
|
|
|
||||||
|
|
@ -78,19 +78,20 @@ void object_database::flush()
|
||||||
void object_database::wipe(const fc::path& data_dir)
|
void object_database::wipe(const fc::path& data_dir)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
ilog("Wiping object_database.");
|
ilog("Wiping object database...");
|
||||||
fc::remove_all(data_dir / "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)
|
void object_database::open(const fc::path& data_dir)
|
||||||
{ try {
|
{ try {
|
||||||
// ilog("Open object_database in ${d}", ("d", data_dir));
|
ilog("Opening object database from ${d} ...", ("d", data_dir));
|
||||||
_data_dir = data_dir;
|
_data_dir = data_dir;
|
||||||
for( uint32_t space = 0; space < _index.size(); ++space )
|
for( uint32_t space = 0; space < _index.size(); ++space )
|
||||||
for( uint32_t type = 0; type < _index[space].size(); ++type )
|
for( uint32_t type = 0; type < _index[space].size(); ++type )
|
||||||
if( _index[space][type] )
|
if( _index[space][type] )
|
||||||
_index[space][type]->open( _data_dir / "object_database" / fc::to_string(space)/fc::to_string(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) ) }
|
} FC_CAPTURE_AND_RETHROW( (data_dir) ) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ struct bucket_key
|
||||||
|
|
||||||
friend bool operator < ( const bucket_key& a, const bucket_key& b )
|
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 )
|
friend bool operator == ( const bucket_key& a, const bucket_key& b )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue