1
0
Fork 0
forked from lthn/blockchain

coretests: fixed construct_tx_to_key for boundary condition handling for tx_version at the next block height

This commit is contained in:
sowle 2023-04-26 22:49:31 +02:00
parent c69ef90249
commit 438dd74166
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -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)