diff --git a/include/bitcoin/database/impl/query/validate.ipp b/include/bitcoin/database/impl/query/validate.ipp index 096d9cf9..82b9228d 100644 --- a/include/bitcoin/database/impl/query/validate.ipp +++ b/include/bitcoin/database/impl/query/validate.ipp @@ -260,7 +260,7 @@ code CLASS::get_tx_state(uint64_t& fee, size_t& sigops, const tx_link& link, } TEMPLATE -bool CLASS::set_block_valid(const header_link& link) NOEXCEPT +bool CLASS::set_block_valid(const header_link& link, uint64_t fees) NOEXCEPT { // ======================================================================== const auto scope = store_.get_transactor(); @@ -270,14 +270,13 @@ bool CLASS::set_block_valid(const header_link& link) NOEXCEPT { {}, schema::block_state::valid, - 0 // fees + fees }); // ======================================================================== } TEMPLATE -bool CLASS::set_block_confirmable(const header_link& link, - uint64_t fees) NOEXCEPT +bool CLASS::set_block_confirmable(const header_link& link) NOEXCEPT { // ======================================================================== const auto scope = store_.get_transactor(); @@ -287,7 +286,7 @@ bool CLASS::set_block_confirmable(const header_link& link, { {}, schema::block_state::confirmable, - fees + 0 // fees }); // ======================================================================== } diff --git a/include/bitcoin/database/query.hpp b/include/bitcoin/database/query.hpp index 3a33e22b..24b5f72b 100644 --- a/include/bitcoin/database/query.hpp +++ b/include/bitcoin/database/query.hpp @@ -473,9 +473,9 @@ class query bool get_timestamp(uint32_t& timestamp, const header_link& link) const NOEXCEPT; - bool set_block_valid(const header_link& link) NOEXCEPT; + bool set_block_valid(const header_link& link, uint64_t fees) NOEXCEPT; bool set_block_unconfirmable(const header_link& link) NOEXCEPT; - bool set_block_confirmable(const header_link& link, uint64_t fees) NOEXCEPT; + bool set_block_confirmable(const header_link& link) NOEXCEPT; // set_txs_connected is FOR PERFORMANCE EVALUATION ONLY. bool set_txs_connected(const header_link& link) NOEXCEPT; diff --git a/test/query/validate.cpp b/test/query/validate.cpp index 59281bac..086fb837 100644 --- a/test/query/validate.cpp +++ b/test/query/validate.cpp @@ -215,11 +215,11 @@ BOOST_AUTO_TEST_CASE(query_validate__get_block_state__confirmable__block_confirm BOOST_REQUIRE_EQUAL(query.get_block_state(fees, 0), error::unvalidated); BOOST_REQUIRE_EQUAL(fees, 0u); - BOOST_REQUIRE(query.set_block_confirmable(1, 42)); + BOOST_REQUIRE(query.set_block_confirmable(1)); BOOST_REQUIRE_EQUAL(query.get_header_state(1), error::block_confirmable); BOOST_REQUIRE_EQUAL(query.get_block_state(1), error::block_confirmable); BOOST_REQUIRE_EQUAL(query.get_block_state(fees, 1), error::block_confirmable); - BOOST_REQUIRE_EQUAL(fees, 42u); + BOOST_REQUIRE_EQUAL(fees, 0u); } BOOST_AUTO_TEST_CASE(query_validate__get_block_state__valid__block_valid) @@ -233,11 +233,11 @@ BOOST_AUTO_TEST_CASE(query_validate__get_block_state__valid__block_valid) BOOST_REQUIRE(query.set(test::block1, context{}, false, false)); uint64_t fees{}; - BOOST_REQUIRE(query.set_block_valid(1)); + BOOST_REQUIRE(query.set_block_valid(1, 42)); BOOST_REQUIRE_EQUAL(query.get_header_state(1), error::block_valid); BOOST_REQUIRE_EQUAL(query.get_block_state(1), error::block_valid); BOOST_REQUIRE_EQUAL(query.get_block_state(fees, 1), error::block_valid); - BOOST_REQUIRE_EQUAL(fees, 0u); + BOOST_REQUIRE_EQUAL(fees, 42u); } BOOST_AUTO_TEST_CASE(query_validate__get_block_state__unconfirmable__block_unconfirmable)