1
0
Fork 0
forked from lthn/blockchain

fixed RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_COINBASE and added RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_POS_COINBASE for future use

This commit is contained in:
cryptozoidberg 2024-03-26 16:35:00 +01:00
parent cceeda0588
commit 6311c2078f
No known key found for this signature in database
GPG key ID: 2E10CC61CAC8F36D
2 changed files with 9 additions and 3 deletions

View file

@ -2606,6 +2606,14 @@ bool blockchain_storage::add_out_to_get_random_outs(COMMAND_RPC_GET_RANDOM_OUTPU
oen.amount_commitment = toz.amount_commitment;
oen.concealing_point = toz.concealing_point;
oen.blinded_asset_id = toz.blinded_asset_id; // TODO @#@# bad design, too much manual coping, consider redesign -- sowle
if (is_coinbase(tx_ptr->tx))
{
oen.flags |= RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_COINBASE;
if (is_pos_coinbase(tx_ptr->tx))
{
oen.flags |= RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_POS_COINBASE;
}
}
}
VARIANT_SWITCH_END();
@ -2787,9 +2795,6 @@ bool blockchain_storage::get_random_outs_for_amounts3(const COMMAND_RPC_GET_RAND
CRITICAL_REGION_LOCAL(m_read_lock);
LOG_PRINT_L3("[get_random_outs_for_amounts] amounts: " << req.amounts.size());
std::map<uint64_t, uint64_t> amounts_to_up_index_limit_cache;
uint64_t count_zarcanum_blocks = 0;
if(is_hardfork_active(ZANO_HARDFORK_04_ZARCANUM))
count_zarcanum_blocks = this->get_current_blockchain_size() - m_core_runtime_config.hard_forks.m_height_the_hardfork_n_active_after[ZANO_HARDFORK_04_ZARCANUM];
for (size_t i = 0; i != req.amounts.size(); i++)

View file

@ -383,6 +383,7 @@ namespace currency
#define RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_COINBASE 0x0000000000000001LL
#define RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_NOT_ALLOWED 0x0000000000000002LL
#define RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_POS_COINBASE 0x0000000000000004LL
#pragma pack (push, 1)
struct out_entry