diff --git a/include/bitcoin/node/chasers/chaser_confirm.hpp b/include/bitcoin/node/chasers/chaser_confirm.hpp index 14d67eec..e7d760f0 100644 --- a/include/bitcoin/node/chasers/chaser_confirm.hpp +++ b/include/bitcoin/node/chasers/chaser_confirm.hpp @@ -89,7 +89,6 @@ class BCN_API chaser_confirm // These are thread safe. network::asio::strand independent_strand_; - bool prevout_; }; } // namespace node diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 93402e7c..a983c975 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -36,13 +36,11 @@ using namespace std::placeholders; BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) -// Single higher priority thread strand (base class strand uses network pool). -// Higher priority than validator ensures locality to validator reads. +// Independent threadpool and strand (base class strand uses network pool). chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT : chaser(node), threadpool_(one, node.config().node.priority_()), - independent_strand_(threadpool_.service().get_executor()), - prevout_(node.archive().prevout_enabled()) + independent_strand_(threadpool_.service().get_executor()) { } @@ -195,13 +193,6 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT } else if (ec == database::error::block_valid) { - // Set before if not using prevout table. - if (!prevout_ && !query.set_strong(link)) - { - fault(error::confirm2); - return; - } - // Confirmation query. if ((ec = query.block_confirmable(link))) { @@ -213,7 +204,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT } // Unset from set before if not using prevout table. - if (!prevout_ && !query.set_unstrong(link)) + if (!query.set_unstrong(link)) { fault(error::confirm3); return; @@ -231,16 +222,15 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT return; } - // This is not necessary and may overflow the table link. Faster to - // never do it and redo a tiny number of blocks in case of reorg. - ////if (!query.set_block_confirmable(link)) - ////{ - //// fault(error::confirm5); - //// return; - ////} + // Otherwise we will reconfirm entire chain on restart. + if (!query.set_block_confirmable(link)) + { + fault(error::confirm5); + return; + } // Set after if using prevout table. - if (prevout_ && !query.set_strong(link)) + if (!query.set_strong(link)) { fault(error::confirm6); return; diff --git a/src/chasers/chaser_validate.cpp b/src/chasers/chaser_validate.cpp index c9c76298..c9d67c1e 100644 --- a/src/chasers/chaser_validate.cpp +++ b/src/chasers/chaser_validate.cpp @@ -37,8 +37,7 @@ BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR) BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED) BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) -// Multiple higher priority thread strand (base class strand uses network pool). -// Higher priority than downloader (net) ensures locality to downloader writes. +// Independent threadpool and strand (base class strand uses network pool). chaser_validate::chaser_validate(full_node& node) NOEXCEPT : chaser(node), threadpool_(node.config().node.threads_(), node.config().node.priority_()), diff --git a/src/parser.cpp b/src/parser.cpp index 9ebdd4c5..595dc02a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -115,7 +115,7 @@ parser::parser(system::chain::selection context) NOEXCEPT // database (caches) configured.database.prevout_buckets = 850'001; - configured.database.prevout_size = 2'600'000'000; + configured.database.prevout_size = 5'250'000'000; configured.database.prevout_rate = 5; configured.database.validated_tx_buckets = 0; @@ -817,7 +817,7 @@ options_metadata parser::load_settings() THROWS ( "database.prevout_size", value(&configured.database.prevout_size), - "The minimum allocation of the prevout table body, defaults to '2600000000'." + "The minimum allocation of the prevout table body, defaults to '5250000000'." ) ( "database.prevout_rate",