Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
Merge branch 'develop' into devshares
Browse files Browse the repository at this point in the history
  • Loading branch information
vikramrajkumar committed May 1, 2015
2 parents b5f3eb9 + 789d2e7 commit bd669b9
Show file tree
Hide file tree
Showing 30 changed files with 632 additions and 1,842 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ LIST(APPEND BOOST_COMPONENTS thread
unit_test_framework
context
locale)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )

set(Boost_USE_STATIC_LIBS ON)
IF( WIN32 )
SET(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
Expand Down Expand Up @@ -181,7 +181,6 @@ else( WIN32 ) # Apple AND Linux
endif()
endif()

set(Boost_USE_STATIC_LIBS ON)
endif( WIN32 )

list(APPEND LEVEL_DB_SOURCES "${LEVELDB_PORT_FILE}")
Expand Down
12 changes: 8 additions & 4 deletions libraries/blockchain/chain_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ namespace bts { namespace blockchain {
oorder_record orec = pending_state->get_bid_record( bid_itr.key() );
if( (!orec.valid()) || (orec->balance <= 0) )
continue;

market_order morder = market_order( bid_order, bid_itr.key(), *orec );
process_bid( morder.get_price(), morder );
}
Expand Down Expand Up @@ -1155,7 +1155,7 @@ namespace bts { namespace blockchain {
("bid_type", get_order_type( bid_order ))
("ask_type", get_order_type( ask_order ))
);

FC_ASSERT( quote_asset.valid() );
FC_ASSERT( base_asset.valid() );

Expand Down Expand Up @@ -2437,12 +2437,16 @@ namespace bts { namespace blockchain {
};
const auto scan_balance = [ &addrs, &records ]( const balance_record& record )
{
const auto& owner = record.condition.owner();
if( !owner.valid() )
return;

for( const address& addr : addrs )
{
if( record.is_owner( addr ) )
if( addr == *owner )
{
records[ record.id() ] = record;
break;
return;
}
}
};
Expand Down
6 changes: 6 additions & 0 deletions libraries/cli/pretty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ string pretty_line( int size, char c )

string pretty_shorten( const string& str, size_t max_size )
{
if( FILTER_OUTPUT_FOR_TESTS && str.find( "publish version" ) != string::npos )
{
std::size_t start = str.find( "dryrun" );
if( start != string::npos )
return str.substr( 0, start ) + "<d-ign>" + str.substr( start ) + "</d-ign>";
}
if( str.size() > max_size )
return str.substr( 0, max_size - 3 ) + "...";
return str;
Expand Down
3 changes: 2 additions & 1 deletion libraries/client/include/bts/client/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace bts { namespace client {
std::string encrypted_rpc_wif_key;
fc::path htdocs;
map<string,bts::api::permissions> users;
set<string> whitelist;

bool is_valid() const; /* Currently just checks if rpc port is set */
};
Expand Down Expand Up @@ -201,7 +202,7 @@ extern const std::string BTS_MESSAGE_MAGIC;

FC_REFLECT(bts::client::client_notification, (timestamp)(message)(signature) )
FC_REFLECT( bts::client::rpc_server_config, (enable)(enable_cache)(rpc_user)(rpc_password)(rpc_endpoint)(httpd_endpoint)(websocket_endpoint)
(encrypted_rpc_endpoint)(encrypted_rpc_wif_key)(htdocs)(users) )
(encrypted_rpc_endpoint)(encrypted_rpc_wif_key)(htdocs)(users)(whitelist) )
FC_REFLECT( bts::client::chain_server_config, (enabled)(listen_port) )
FC_REFLECT( bts::client::config,
(logging)
Expand Down
19 changes: 19 additions & 0 deletions libraries/db/include/bts/db/cached_level_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace bts { namespace db {
_sync_on_write = sync_on_write;
} FC_CAPTURE_AND_RETHROW( (dir)(create)(leveldb_cache_size)(write_through)(sync_on_write) ) }

bool is_open() { return _db.is_open(); }

void close()
{ try {
if( _db.is_open() ) flush();
Expand All @@ -38,6 +40,8 @@ namespace bts { namespace db {
_write_through = write_through;
} FC_CAPTURE_AND_RETHROW( (write_through) ) }

void set_sync_on_write( bool sync_on_write ) { _sync_on_write = sync_on_write; }

void flush()
{ try {
typename level_map<Key, Value>::write_batch batch = _db.create_batch( _sync_on_write );
Expand Down Expand Up @@ -81,6 +85,21 @@ namespace bts { namespace db {
}
} FC_CAPTURE_AND_RETHROW( (key)(value) ) }

// parameter `sync_on_write` takes effect only when `_write_through == true`
void store( const Key& key, const Value& value, bool sync_on_write )
{ try {
_cache[ key ] = value;
if( _write_through )
{
_db.store( key, value, sync_on_write );
}
else
{
_dirty_store.insert( key );
_dirty_remove.erase( key );
}
} FC_CAPTURE_AND_RETHROW( (key)(value)(sync_on_write) ) }

void remove( const Key& key )
{ try {
_cache.erase( key );
Expand Down
93 changes: 0 additions & 93 deletions libraries/db/include/bts/db/flat_index.hpp

This file was deleted.

85 changes: 0 additions & 85 deletions libraries/db/include/bts/db/fs_hash_map.hpp

This file was deleted.

12 changes: 0 additions & 12 deletions libraries/db/include/bts/db/fwd.hpp

This file was deleted.

80 changes: 0 additions & 80 deletions libraries/db/include/bts/db/generic_index.hpp

This file was deleted.

0 comments on commit bd669b9

Please sign in to comment.