From 77112a44f6bb4d5cf6071c9d75749fe4fe6aff3c Mon Sep 17 00:00:00 2001 From: evoskuil Date: Thu, 27 Jun 2024 18:24:22 -0400 Subject: [PATCH] Restore redundant variant types. --- include/bitcoin/node/define.hpp | 10 ++-------- include/bitcoin/node/impl/chasers/chaser_organize.ipp | 10 ++++------ src/chasers/chaser_check.cpp | 5 ++--- src/chasers/chaser_template.cpp | 5 ++--- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/include/bitcoin/node/define.hpp b/include/bitcoin/node/define.hpp index ce7e833a..dd74a0be 100644 --- a/include/bitcoin/node/define.hpp +++ b/include/bitcoin/node/define.hpp @@ -72,14 +72,8 @@ using count_t = size_t; using height_t = size_t; using channel_t = uint64_t; using object_t = object_key; - -// HACK: xcode sees header_t unique from uint32_t if defined from links. -// HACK: but clag/gcc/msvc do not, so is a conflict there to add it. -using header_t = uint32_t; -using transaction_t = uint32_t; -static_assert(sizeof(header_t) == sizeof(database::header_link::integer)); -static_assert(sizeof(transaction_t) == sizeof(database::tx_link::integer)); - +using header_t = database::header_link::integer; +using transaction_t = database::tx_link::integer; typedef system::chain::block::cptr block_t; ////typedef struct ////{ diff --git a/include/bitcoin/node/impl/chasers/chaser_organize.ipp b/include/bitcoin/node/impl/chasers/chaser_organize.ipp index e4270f24..00a7d7dc 100644 --- a/include/bitcoin/node/impl/chasers/chaser_organize.ipp +++ b/include/bitcoin/node/impl/chasers/chaser_organize.ipp @@ -95,18 +95,16 @@ bool CLASS::handle_event(const code&, chase event_, event_value value) NOEXCEPT case chase::unvalid: case chase::unconfirmable: { - // HACK: header_t // Roll back the candidate chain to confirmed top (via fork point). - BC_ASSERT(std::holds_alternative(value)); - POST(do_disorganize, std::get(value)); + BC_ASSERT(std::holds_alternative(value)); + POST(do_disorganize, std::get(value)); break; } case chase::malleated: { - // HACK: header_t // Re-obtain the malleated block if it is still a candidate (virtual). - BC_ASSERT(std::holds_alternative(value)); - POST(do_malleated, std::get(value)); + BC_ASSERT(std::holds_alternative(value)); + POST(do_malleated, std::get(value)); break; } case chase::stop: diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index 69c538a6..25401fa4 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -126,9 +126,8 @@ bool chaser_check::handle_event(const code&, chase event_, // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ case chase::header: { - // HACK: header_t - BC_ASSERT(std::holds_alternative(value)); - POST(do_header, std::get(value)); + BC_ASSERT(std::holds_alternative(value)); + POST(do_header, std::get(value)); break; } case chase::headers: diff --git a/src/chasers/chaser_template.cpp b/src/chasers/chaser_template.cpp index 4aac5334..411c4460 100644 --- a/src/chasers/chaser_template.cpp +++ b/src/chasers/chaser_template.cpp @@ -62,9 +62,8 @@ bool chaser_template::handle_event(const code&, chase event_, { case chase::transaction: { - // HACK: transaction_t - BC_ASSERT(std::holds_alternative(value)); - POST(do_transaction, std::get(value)); + BC_ASSERT(std::holds_alternative(value)); + POST(do_transaction, std::get(value)); break; } case chase::stop: