diff --git a/nano/core_test/confirmation_solicitor.cpp b/nano/core_test/confirmation_solicitor.cpp index 7afa210a..a35ff989 100644 --- a/nano/core_test/confirmation_solicitor.cpp +++ b/nano/core_test/confirmation_solicitor.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/election_scheduler.cpp b/nano/core_test/election_scheduler.cpp index c453bfe0..92afc9b2 100644 --- a/nano/core_test/election_scheduler.cpp +++ b/nano/core_test/election_scheduler.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/nano/core_test/request_aggregator.cpp b/nano/core_test/request_aggregator.cpp index 7b1913f4..3851fa82 100644 --- a/nano/core_test/request_aggregator.cpp +++ b/nano/core_test/request_aggregator.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/nano/core_test/vote_processor.cpp b/nano/core_test/vote_processor.cpp index f755eb8a..6e271568 100644 --- a/nano/core_test/vote_processor.cpp +++ b/nano/core_test/vote_processor.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/nano/core_test/wallet.cpp b/nano/core_test/wallet.cpp index de2cfb42..358ee2d2 100644 --- a/nano/core_test/wallet.cpp +++ b/nano/core_test/wallet.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/core_test/wallets.cpp b/nano/core_test/wallets.cpp index af4b953b..48c0e79d 100644 --- a/nano/core_test/wallets.cpp +++ b/nano/core_test/wallets.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index 9602dc0a..439ee94f 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -75,6 +75,7 @@ add_library( distributed_work_factory.cpp election.hpp election.cpp + election_behavior.hpp election_insertion_result.hpp epoch_upgrader.hpp epoch_upgrader.cpp @@ -164,6 +165,7 @@ add_library( vote_cache.cpp vote_processor.hpp vote_processor.cpp + vote_with_weight_info.hpp voting.hpp voting.cpp wallet.hpp diff --git a/nano/node/active_transactions.hpp b/nano/node/active_transactions.hpp index 7323bf51..e1dececf 100644 --- a/nano/node/active_transactions.hpp +++ b/nano/node/active_transactions.hpp @@ -1,8 +1,9 @@ #pragma once #include -#include +#include #include +#include #include #include diff --git a/nano/node/election.hpp b/nano/node/election.hpp index 59cf2ea9..5ea0c43c 100644 --- a/nano/node/election.hpp +++ b/nano/node/election.hpp @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include @@ -24,34 +26,6 @@ public: nano::block_hash hash; }; -class vote_with_weight_info final -{ -public: - nano::account representative; - std::chrono::steady_clock::time_point time; - uint64_t timestamp; - nano::block_hash hash; - nano::uint128_t weight; -}; - -enum class election_behavior -{ - normal, - /** - * Hinted elections: - * - shorter timespan - * - limited space inside AEC - */ - hinted, - /** - * Optimistic elections: - * - shorter timespan - * - limited space inside AEC - * - more frequent confirmation requests - */ - optimistic, -}; - nano::stat::detail to_stat_detail (nano::election_behavior); // map of vote weight per block, ordered greater first diff --git a/nano/node/election_behavior.hpp b/nano/node/election_behavior.hpp new file mode 100644 index 00000000..c78733a3 --- /dev/null +++ b/nano/node/election_behavior.hpp @@ -0,0 +1,22 @@ +#pragma once + +namespace nano +{ +enum class election_behavior +{ + normal, + /** + * Hinted elections: + * - shorter timespan + * - limited space inside AEC + */ + hinted, + /** + * Optimistic elections: + * - shorter timespan + * - limited space inside AEC + * - more frequent confirmation requests + */ + optimistic, +}; +} diff --git a/nano/node/node.hpp b/nano/node/node.hpp index fe7e901a..5c0e705a 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/nano/node/scheduler/manual.cpp b/nano/node/scheduler/manual.cpp index 7fc908bd..f84774bc 100644 --- a/nano/node/scheduler/manual.cpp +++ b/nano/node/scheduler/manual.cpp @@ -1,3 +1,4 @@ +#include #include #include diff --git a/nano/node/scheduler/priority.cpp b/nano/node/scheduler/priority.cpp index f8e03ff3..b37276e0 100644 --- a/nano/node/scheduler/priority.cpp +++ b/nano/node/scheduler/priority.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/nano/node/vote_cache.cpp b/nano/node/vote_cache.cpp index 4d40807d..7779b0af 100644 --- a/nano/node/vote_cache.cpp +++ b/nano/node/vote_cache.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -280,4 +281,4 @@ nano::error nano::vote_cache_config::deserialize (nano::tomlconfig & toml) age_cutoff = std::chrono::seconds{ age_cutoff_l }; return toml.get_error (); -} \ No newline at end of file +} diff --git a/nano/node/vote_with_weight_info.hpp b/nano/node/vote_with_weight_info.hpp new file mode 100644 index 00000000..02daa9bb --- /dev/null +++ b/nano/node/vote_with_weight_info.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include + +namespace nano +{ +class vote_with_weight_info final +{ +public: + nano::account representative; + std::chrono::steady_clock::time_point time; + uint64_t timestamp; + nano::block_hash hash; + nano::uint128_t weight; +}; +} diff --git a/nano/node/websocket.hpp b/nano/node/websocket.hpp index 62121984..db470f74 100644 --- a/nano/node/websocket.hpp +++ b/nano/node/websocket.hpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nano/qt/qt.cpp b/nano/qt/qt.cpp index 6c578f06..744cf095 100644 --- a/nano/qt/qt.cpp +++ b/nano/qt/qt.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index 7d4e0705..5d5e4190 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/nano/test_common/testutil.cpp b/nano/test_common/testutil.cpp index ce80cfea..114a7813 100644 --- a/nano/test_common/testutil.cpp +++ b/nano/test_common/testutil.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include