From 438dd74166c0c2edd5208fa094362db5a57a4087 Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 26 Apr 2023 22:49:31 +0200 Subject: [PATCH] coretests: fixed construct_tx_to_key for boundary condition handling for tx_version at the next block height --- tests/core_tests/chaingen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index 5ff7a81c..32ba7264 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -1653,7 +1653,8 @@ bool construct_tx_to_key(const currency::hard_forks_descriptor& hf, if (!fill_tx_sources(sources, events, blk_head, from.get_keys(), spending_amount, nmix, check_for_spends, check_for_unlocktime, use_ref_by_id)) return false; - uint64_t tx_version = currency::get_tx_version(get_block_height(blk_head), hf); + uint64_t tx_expected_block_height = get_block_height(blk_head) + 1; + uint64_t tx_version = currency::get_tx_version(tx_expected_block_height, hf); boost::multiprecision::int128_t change = get_sources_total_amount(sources); change -= spending_amount; if (change < 0)