diff --git a/src/carrot_impl/format_utils.h b/src/carrot_impl/format_utils.h index 5c90dcd0d..ec300918d 100644 --- a/src/carrot_impl/format_utils.h +++ b/src/carrot_impl/format_utils.h @@ -46,7 +46,7 @@ namespace carrot { -static constexpr std::uint8_t carrot_v1_rct_type = rct::RCTTypeFcmpPlusPlus; +static constexpr std::uint8_t carrot_v1_rct_type = rct::RCTTypeSalviumOne; template static inline T raw_byte_convert(const U &u) diff --git a/src/ringct/rctTypes.cpp b/src/ringct/rctTypes.cpp index c3328737a..4d0829145 100644 --- a/src/ringct/rctTypes.cpp +++ b/src/ringct/rctTypes.cpp @@ -264,7 +264,8 @@ namespace rct { case RCTTypeBulletproof2: case RCTTypeCLSAG: case RCTTypeBulletproofPlus: - case RCTTypeFcmpPlusPlus: + case RCTTypeFullProofs: + case RCTTypeSalviumOne: return true; case RCTTypeNull: case RCTTypeFull: diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h index be737cd3c..630222c4b 100644 --- a/src/ringct/rctTypes.h +++ b/src/ringct/rctTypes.h @@ -318,8 +318,7 @@ namespace rct { RCTTypeCLSAG = 5, RCTTypeBulletproofPlus = 6, RCTTypeFullProofs = 7, - RCTTypeSalviumOne = 8, - RCTTypeFcmpPlusPlus = 9 + RCTTypeSalviumOne = 8 }; enum RangeProofType { RangeProofBorromean, RangeProofBulletproof, RangeProofMultiOutputBulletproof, RangeProofPaddedBulletproof }; struct RCTConfig { diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 69541af84..6291ade6d 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2450,6 +2450,7 @@ void wallet2::process_new_transaction( epee::to_span(enote_scan_infos), epee::to_span(output_key_images), o_indices, + asset_type_o_indices, height, block_version, ts, @@ -2466,6 +2467,7 @@ void wallet2::process_new_scanned_transaction( const epee::span> enote_scan_infos, const epee::span> output_key_images, const std::vector &o_indices, + const std::vector &asset_type_o_indices, const uint64_t height, const uint8_t block_version, const uint64_t ts, @@ -2597,9 +2599,11 @@ void wallet2::process_new_scanned_transaction( td.m_block_height = height; td.m_internal_output_index = local_output_index; td.m_global_output_index = o_indices.at(local_output_index); + td.m_asset_type_output_index = asset_type_o_indices.at(local_output_index); td.m_tx = tx; td.m_txid = txid; td.m_amount = enote_scan_info->amount; + td.asset_type = enote_scan_info->asset_type; td.m_pk_index = enote_scan_info->main_tx_pubkey_index; td.m_subaddr_index = subaddr_index_cn; td.m_mask = enote_scan_info->amount_blinding_factor; @@ -2937,27 +2941,52 @@ void wallet2::process_new_blockchain_entry(const cryptonote::block& b, //optimization: seeking only for blocks that are not older then the wallet creation time plus 1 day. 1 day is for possible user incorrect time setup if (!should_skip_block(b, height)) { + // Miner_tx size_t n_outs_in_tx = b.miner_tx.vout.size(); TIME_MEASURE_START(miner_tx_handle_time); if (m_refresh_type != RefreshNoCoinbase) { process_new_scanned_transaction(get_transaction_hash(b.miner_tx), - b.miner_tx, - {enote_scan_infos.data(), std::min(enote_scan_infos.size(), n_outs_in_tx)}, - {output_key_images.data(), std::min(output_key_images.size(), n_outs_in_tx)}, - parsed_block.o_indices.indices[0].indices, - height, - b.major_version, - b.timestamp, - /*miner_tx=*/true, - /*pool=*/false, - /*double_spend_seen=*/false, - output_tracker_cache); + b.miner_tx, + {enote_scan_infos.data(), std::min(enote_scan_infos.size(), n_outs_in_tx)}, + {output_key_images.data(), std::min(output_key_images.size(), n_outs_in_tx)}, + parsed_block.o_indices.indices[0].indices, + parsed_block.asset_type_output_indices.indices[0].indices, + height, + b.major_version, + b.timestamp, + /*miner_tx=*/true, + /*pool=*/false, + /*double_spend_seen=*/false, + output_tracker_cache); } enote_scan_infos.remove_prefix(n_outs_in_tx); output_key_images.remove_prefix(n_outs_in_tx); TIME_MEASURE_FINISH(miner_tx_handle_time); + // protocol_tx + n_outs_in_tx = b.protocol_tx.vout.size(); + TIME_MEASURE_START(protocol_tx_handle_time); + if (m_refresh_type != RefreshNoCoinbase) + { + process_new_scanned_transaction(get_transaction_hash(b.protocol_tx), + b.protocol_tx, + {enote_scan_infos.data(), std::min(enote_scan_infos.size(), n_outs_in_tx)}, + {output_key_images.data(), std::min(output_key_images.size(), n_outs_in_tx)}, + parsed_block.o_indices.indices[1].indices, + parsed_block.asset_type_output_indices.indices[1].indices, + height, + b.major_version, + b.timestamp, + /*miner_tx=*/true, + /*pool=*/false, + /*double_spend_seen=*/false, + output_tracker_cache); + } + enote_scan_infos.remove_prefix(n_outs_in_tx); + output_key_images.remove_prefix(n_outs_in_tx); + TIME_MEASURE_FINISH(protocol_tx_handle_time); + TIME_MEASURE_START(txs_handle_time); THROW_WALLET_EXCEPTION_IF(bche.txs.size() != b.tx_hashes.size(), error::wallet_internal_error, "Wrong amount of transactions for block"); THROW_WALLET_EXCEPTION_IF(bche.txs.size() != parsed_block.txes.size(), error::wallet_internal_error, "Wrong amount of transactions for block"); @@ -2966,17 +2995,18 @@ void wallet2::process_new_blockchain_entry(const cryptonote::block& b, const cryptonote::transaction &tx = parsed_block.txes.at(idx); n_outs_in_tx = tx.vout.size(); process_new_scanned_transaction(b.tx_hashes[idx], - tx, - {enote_scan_infos.data(), std::min(enote_scan_infos.size(), n_outs_in_tx)}, - {output_key_images.data(), std::min(output_key_images.size(), n_outs_in_tx)}, - parsed_block.o_indices.indices[idx+1].indices, - height, - b.major_version, - b.timestamp, - /*miner_tx=*/false, - /*pool=*/false, - /*double_spend_seen=*/false, - output_tracker_cache); + tx, + {enote_scan_infos.data(), std::min(enote_scan_infos.size(), n_outs_in_tx)}, + {output_key_images.data(), std::min(output_key_images.size(), n_outs_in_tx)}, + parsed_block.o_indices.indices[idx+2].indices, + parsed_block.asset_type_output_indices.indices[idx+2].indices, + height, + b.major_version, + b.timestamp, + /*miner_tx=*/false, + /*pool=*/false, + /*double_spend_seen=*/false, + output_tracker_cache); enote_scan_infos.remove_prefix(n_outs_in_tx); output_key_images.remove_prefix(n_outs_in_tx); } diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 4ee32043b..c4f8e4c1d 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -1931,6 +1931,7 @@ private: const epee::span> enote_scan_infos, const epee::span> output_key_images, const std::vector &o_indices, + const std::vector &asset_type_o_indices, const uint64_t height, const uint8_t block_version, const uint64_t ts,