diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt index ab7130277..5f35d9c9e 100644 --- a/src/blockchain_utilities/CMakeLists.txt +++ b/src/blockchain_utilities/CMakeLists.txt @@ -142,20 +142,23 @@ set(blockchain_scanner_private_headers) monero_private_headers(blockchain_scanner ${blockchain_scanner_private_headers}) -if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp" AND NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp") - set(blockchain_audit_sources - blockchain_audit.cpp - threadpool_boost.cpp - ) - - set(blockchain_audit_private_headers - threadpool_boost.h - ) - - monero_private_headers(blockchain_audit - ${blockchain_audit_private_headers}) +if (BUILD_TAG) else() + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp" AND NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp") + set(blockchain_audit_sources + blockchain_audit.cpp + threadpool_boost.cpp + ) + + set(blockchain_audit_private_headers + threadpool_boost.h + ) + + monero_private_headers(blockchain_audit + ${blockchain_audit_private_headers}) + else() message(STATUS "blockchain_audit.cpp not found - not building the audit tool") + endif() endif() monero_add_executable(blockchain_import @@ -327,33 +330,36 @@ set_property(TARGET blockchain_scanner OUTPUT_NAME "salvium-blockchain-scanner") install(TARGETS blockchain_scanner DESTINATION bin) -if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp" AND NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp") - monero_add_executable(blockchain_audit - ${blockchain_audit_sources} - ${blockchain_audit_private_headers}) +if (BUILD_TAG) +else() + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp" AND NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/blockchain_audit.cpp") + monero_add_executable(blockchain_audit + ${blockchain_audit_sources} + ${blockchain_audit_private_headers}) - target_include_directories(blockchain_audit PRIVATE /usr/include/mysql-cppconn/jdbc) + target_include_directories(blockchain_audit PRIVATE /usr/include/mysql-cppconn/jdbc) - target_link_libraries(blockchain_audit - PRIVATE - wallet - crypto - cncrypto - cryptonote_core - blockchain_db - version - epee - mysqlcppconn - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT} - ${EXTRA_LIBRARIES}) + target_link_libraries(blockchain_audit + PRIVATE + wallet + crypto + cncrypto + cryptonote_core + blockchain_db + version + epee + mysqlcppconn + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBRARIES}) - set_property(TARGET blockchain_audit - PROPERTY - OUTPUT_NAME "salvium-blockchain-audit") - install(TARGETS blockchain_audit DESTINATION bin) + set_property(TARGET blockchain_audit + PROPERTY + OUTPUT_NAME "salvium-blockchain-audit") + install(TARGETS blockchain_audit DESTINATION bin) + endif() endif() monero_add_executable(blockchain_stats diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index af48252b9..e57dd38a4 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -231,6 +231,8 @@ #define HF_VERSION_AUDIT1 6 #define HF_VERSION_SALVIUM_ONE_PROOFS 6 +#define HF_VERSION_AUDIT1_PAUSE 7 + #define HF_VERSION_REQUIRE_VIEW_TAGS 255 #define HF_VERSION_ENABLE_CONVERT 255 #define HF_VERSION_ENABLE_ORACLE 255 diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 0ac692224..c68853fe1 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1505,6 +1505,7 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl case HF_VERSION_ENFORCE_FULL_PROOFS: case HF_VERSION_SHUTDOWN_USER_TXS: case HF_VERSION_SALVIUM_ONE_PROOFS: + case HF_VERSION_AUDIT1_PAUSE: if (b.miner_tx.amount_burnt > 0) { CHECK_AND_ASSERT_MES(money_in_use + b.miner_tx.amount_burnt > money_in_use, false, "miner transaction is overflowed by amount_burnt"); money_in_use += b.miner_tx.amount_burnt; @@ -4087,7 +4088,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc, const rct::rctSig &rv = tx.rct_signatures; // Check that after full proofs are enabled, the RCT version is set to enforce full proofs - if (hf_version == HF_VERSION_SALVIUM_ONE_PROOFS) { + if (hf_version >= HF_VERSION_SALVIUM_ONE_PROOFS) { if (rv.type != rct::RCTTypeNull && rv.type != rct::RCTTypeSalviumOne) { MERROR_VER("Unsupported rct type (full proofs (with audit data) are required): " << rv.type); return false; diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 6ad024fe5..8e7ba0b58 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -448,6 +448,7 @@ namespace cryptonote case HF_VERSION_ENFORCE_FULL_PROOFS: case HF_VERSION_SHUTDOWN_USER_TXS: case HF_VERSION_SALVIUM_ONE_PROOFS: + case HF_VERSION_AUDIT1_PAUSE: // SRCG: subtract 20% that will be rewarded to staking users CHECK_AND_ASSERT_MES(tx.amount_burnt == 0, false, "while creating outs: amount_burnt is nonzero"); tx.amount_burnt = amount / 5; diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 8ba862609..ba405de38 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1564,11 +1564,11 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const Monero::transact fake_outs_count = m_wallet->adjust_mixin(mixin_count); if (amount) { - transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, "SAL", "SAL", converted_tx_type, fake_outs_count, 0 /* unlock_time */, + transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, asset_type, asset_type, converted_tx_type, fake_outs_count, 0 /* unlock_time */, adjusted_priority, extra, subaddr_account, subaddr_indices); } else { - transaction->m_pending_tx = m_wallet->create_transactions_all(0, converted_tx_type, "SAL", info.address, info.is_subaddress, 1, fake_outs_count, 0 /* unlock_time */, + transaction->m_pending_tx = m_wallet->create_transactions_all(0, converted_tx_type, asset_type, info.address, info.is_subaddress, 1, fake_outs_count, 0 /* unlock_time */, adjusted_priority, extra, subaddr_account, subaddr_indices); }