Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions include/bitcoin/node/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BCN_API settings
settings(system::chain::selection context) NOEXCEPT;

/// Properties.
uint32_t threads;
bool delay_inbound;
bool headers_first;
bool thread_priority;
Expand All @@ -47,14 +48,15 @@ class BCN_API settings
float minimum_bump_rate;
uint16_t announcement_cache;
uint16_t fee_estimate_horizon;
////uint64_t snapshot_bytes;
////uint32_t snapshot_valid;
////uint32_t snapshot_confirm;
uint32_t maximum_height;
uint32_t maximum_concurrency;
uint16_t sample_period_seconds;
uint32_t currency_window_minutes;
uint32_t threads;
uint16_t warn_dirty_background_ratio;
uint16_t warn_dirty_ratio;
////uint64_t snapshot_bytes;
////uint32_t snapshot_valid;
////uint32_t snapshot_confirm;

/// Helpers.
virtual size_t threads_() const NOEXCEPT;
Expand Down
6 changes: 4 additions & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace libbitcoin {
namespace node {

settings::settings() NOEXCEPT
: delay_inbound{ true },
: threads{ 1 },
delay_inbound{ true },
headers_first{ true },
memory_priority{ true },
thread_priority{ true },
Expand All @@ -50,7 +51,8 @@ settings::settings() NOEXCEPT
maximum_concurrency{ 50'000 },
sample_period_seconds{ 10 },
currency_window_minutes{ 1440 },
threads{ 1 }
warn_dirty_background_ratio{ 90_u16 },
warn_dirty_ratio{ 90_u16 }
{
}

Expand Down
10 changes: 6 additions & 4 deletions test/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected)
using namespace network;

const node::settings node{};
BOOST_REQUIRE_EQUAL(node.threads, 1_u32);
BOOST_REQUIRE_EQUAL(node.delay_inbound, true);
BOOST_REQUIRE_EQUAL(node.headers_first, true);
BOOST_REQUIRE_EQUAL(node.memory_priority, true);
Expand All @@ -43,16 +44,17 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected)
BOOST_REQUIRE_EQUAL(node.allowed_deviation, 1.5);
BOOST_REQUIRE_EQUAL(node.announcement_cache, 42_u16);
BOOST_REQUIRE_EQUAL(node.fee_estimate_horizon, 0u);
////BOOST_REQUIRE_EQUAL(node.snapshot_bytes, 200'000'000'000_u64);
////BOOST_REQUIRE_EQUAL(node.snapshot_valid, 250'000_u32);
////BOOST_REQUIRE_EQUAL(node.snapshot_confirm, 500'000_u32);
BOOST_REQUIRE_EQUAL(node.maximum_height, 0_u32);
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency, 50000_u32);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency_(), 50000_size);
BOOST_REQUIRE_EQUAL(node.sample_period_seconds, 10_u16);
BOOST_REQUIRE_EQUAL(node.currency_window_minutes, 1440_u32);
BOOST_REQUIRE_EQUAL(node.threads, 1_u32);
BOOST_REQUIRE_EQUAL(node.warn_dirty_background_ratio, 90_u16);
BOOST_REQUIRE_EQUAL(node.warn_dirty_ratio, 90_u16);
////BOOST_REQUIRE_EQUAL(node.snapshot_bytes, 200'000'000'000_u64);
////BOOST_REQUIRE_EQUAL(node.snapshot_valid, 250'000_u32);
////BOOST_REQUIRE_EQUAL(node.snapshot_confirm, 500'000_u32);

BOOST_REQUIRE_EQUAL(node.threads_(), one);
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);
Expand Down
Loading