fixed some compilation issues on older compilers; disabled building of blockchain_utilities that prevent Mac from building statically

This commit is contained in:
Some Random Crypto Guy
2024-06-17 14:14:32 +01:00
parent 2be6890593
commit 226be59900
6 changed files with 140 additions and 127 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ if(NOT IOS)
add_subdirectory(gen_ssl_cert) add_subdirectory(gen_ssl_cert)
add_subdirectory(daemonizer) add_subdirectory(daemonizer)
add_subdirectory(daemon) add_subdirectory(daemon)
# add_subdirectory(blockchain_utilities) add_subdirectory(blockchain_utilities)
endif() endif()
if(BUILD_DEBUG_UTILITIES) if(BUILD_DEBUG_UTILITIES)
+131 -119
View File
@@ -133,55 +133,59 @@ monero_private_headers(blockchain_stats
${blockchain_stats_private_headers}) ${blockchain_stats_private_headers})
monero_add_executable(blockchain_import #monero_add_executable(blockchain_import
${blockchain_import_sources} # ${blockchain_import_sources}
${blockchain_import_private_headers}) # ${blockchain_import_private_headers})
target_link_libraries(blockchain_import #target_link_libraries(blockchain_import
PRIVATE # PRIVATE
cryptonote_core # crypto
blockchain_db # cncrypto
oracle # cryptonote_core
version # blockchain_db
epee # oracle
${Boost_FILESYSTEM_LIBRARY} # version
${Boost_SYSTEM_LIBRARY} # epee
${Boost_THREAD_LIBRARY} # ${Boost_FILESYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} # ${Boost_SYSTEM_LIBRARY}
${EXTRA_LIBRARIES} # ${Boost_THREAD_LIBRARY}
${Blocks}) # ${CMAKE_THREAD_LIBS_INIT}
# ${EXTRA_LIBRARIES}
# ${Blocks})
if(ARCH_WIDTH) #if(ARCH_WIDTH)
target_compile_definitions(blockchain_import # target_compile_definitions(blockchain_import
PUBLIC -DARCH_WIDTH=${ARCH_WIDTH}) # PUBLIC -DARCH_WIDTH=${ARCH_WIDTH})
endif() #endif()
set_property(TARGET blockchain_import #set_property(TARGET blockchain_import
PROPERTY # PROPERTY
OUTPUT_NAME "salvium-blockchain-import") # OUTPUT_NAME "salvium-blockchain-import")
install(TARGETS blockchain_import DESTINATION bin) #install(TARGETS blockchain_import DESTINATION bin)
monero_add_executable(blockchain_export #monero_add_executable(blockchain_export
${blockchain_export_sources} # ${blockchain_export_sources}
${blockchain_export_private_headers}) # ${blockchain_export_private_headers})
target_link_libraries(blockchain_export #target_link_libraries(blockchain_export
PRIVATE # PRIVATE
cryptonote_core # crypto
blockchain_db # cncrypto
oracle # cryptonote_core
version # blockchain_db
epee # oracle
${Boost_FILESYSTEM_LIBRARY} # version
${Boost_SYSTEM_LIBRARY} # epee
${Boost_THREAD_LIBRARY} # ${Boost_FILESYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} # ${Boost_SYSTEM_LIBRARY}
${EXTRA_LIBRARIES}) # ${Boost_THREAD_LIBRARY}
# ${CMAKE_THREAD_LIBS_INIT}
# ${EXTRA_LIBRARIES})
set_property(TARGET blockchain_export #set_property(TARGET blockchain_export
PROPERTY # PROPERTY
OUTPUT_NAME "salvium-blockchain-export") # OUTPUT_NAME "salvium-blockchain-export")
install(TARGETS blockchain_export DESTINATION bin) #install(TARGETS blockchain_export DESTINATION bin)
monero_add_executable(blockchain_blackball monero_add_executable(blockchain_blackball
${blockchain_blackball_sources} ${blockchain_blackball_sources}
@@ -190,6 +194,8 @@ monero_add_executable(blockchain_blackball
target_link_libraries(blockchain_blackball target_link_libraries(blockchain_blackball
PRIVATE PRIVATE
wallet wallet
crypto
cncrypto
cryptonote_core cryptonote_core
blockchain_db blockchain_db
oracle oracle
@@ -207,93 +213,95 @@ set_property(TARGET blockchain_blackball
install(TARGETS blockchain_blackball DESTINATION bin) install(TARGETS blockchain_blackball DESTINATION bin)
monero_add_executable(blockchain_usage #monero_add_executable(blockchain_usage
${blockchain_usage_sources} # ${blockchain_usage_sources}
${blockchain_usage_private_headers}) # ${blockchain_usage_private_headers})
target_link_libraries(blockchain_usage #target_link_libraries(blockchain_usage
PRIVATE # PRIVATE
cryptonote_core # crypto
blockchain_db # cncrypto
oracle # cryptonote_core
version # blockchain_db
epee # oracle
${Boost_FILESYSTEM_LIBRARY} # version
${Boost_SYSTEM_LIBRARY} # epee
${Boost_THREAD_LIBRARY} # ${Boost_FILESYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} # ${Boost_SYSTEM_LIBRARY}
${EXTRA_LIBRARIES}) # ${Boost_THREAD_LIBRARY}
# ${CMAKE_THREAD_LIBS_INIT}
# ${EXTRA_LIBRARIES})
set_property(TARGET blockchain_usage #set_property(TARGET blockchain_usage
PROPERTY # PROPERTY
OUTPUT_NAME "salvium-blockchain-usage") # OUTPUT_NAME "salvium-blockchain-usage")
install(TARGETS blockchain_usage DESTINATION bin) #nstall(TARGETS blockchain_usage DESTINATION bin)
monero_add_executable(blockchain_ancestry #monero_add_executable(blockchain_ancestry
${blockchain_ancestry_sources} # ${blockchain_ancestry_sources}
${blockchain_ancestry_private_headers}) # ${blockchain_ancestry_private_headers})
target_link_libraries(blockchain_ancestry #target_link_libraries(blockchain_ancestry
PRIVATE # PRIVATE
cryptonote_core # cryptonote_core
blockchain_db # blockchain_db
oracle # oracle
version # version
epee # epee
${Boost_FILESYSTEM_LIBRARY} # ${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY} # ${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY} # ${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} # ${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES}) # ${EXTRA_LIBRARIES})
set_property(TARGET blockchain_ancestry #set_property(TARGET blockchain_ancestry
PROPERTY # PROPERTY
OUTPUT_NAME "salvium-blockchain-ancestry") # OUTPUT_NAME "salvium-blockchain-ancestry")
install(TARGETS blockchain_ancestry DESTINATION bin) #install(TARGETS blockchain_ancestry DESTINATION bin)
monero_add_executable(blockchain_depth # monero_add_executable(blockchain_depth
${blockchain_depth_sources} # ${blockchain_depth_sources}
${blockchain_depth_private_headers}) # ${blockchain_depth_private_headers})
target_link_libraries(blockchain_depth #target_link_libraries(blockchain_depth
PRIVATE # PRIVATE
cryptonote_core # cryptonote_core
blockchain_db # blockchain_db
oracle # oracle
version # version
epee # epee
${Boost_FILESYSTEM_LIBRARY} # ${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY} # ${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY} # ${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} # ${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES}) # ${EXTRA_LIBRARIES})
set_property(TARGET blockchain_depth #set_property(TARGET blockchain_depth
PROPERTY # PROPERTY
OUTPUT_NAME "salvium-blockchain-depth") # OUTPUT_NAME "salvium-blockchain-depth")
install(TARGETS blockchain_depth DESTINATION bin) #install(TARGETS blockchain_depth DESTINATION bin)
monero_add_executable(blockchain_stats #monero_add_executable(blockchain_stats
${blockchain_stats_sources} # ${blockchain_stats_sources}
${blockchain_stats_private_headers}) # ${blockchain_stats_private_headers})
target_link_libraries(blockchain_stats #target_link_libraries(blockchain_stats
PRIVATE # PRIVATE
cryptonote_core # cryptonote_core
blockchain_db # blockchain_db
oracle # oracle
version # version
epee # epee
${Boost_FILESYSTEM_LIBRARY} # ${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY} # ${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY} # ${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} # ${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES}) # ${EXTRA_LIBRARIES})
set_property(TARGET blockchain_stats #set_property(TARGET blockchain_stats
PROPERTY # PROPERTY
OUTPUT_NAME "salvium-blockchain-stats") # OUTPUT_NAME "salvium-blockchain-stats")
install(TARGETS blockchain_stats DESTINATION bin) #install(TARGETS blockchain_stats DESTINATION bin)
monero_add_executable(blockchain_prune_known_spent_data monero_add_executable(blockchain_prune_known_spent_data
${blockchain_prune_known_spent_data_sources} ${blockchain_prune_known_spent_data_sources}
@@ -301,6 +309,8 @@ monero_add_executable(blockchain_prune_known_spent_data
target_link_libraries(blockchain_prune_known_spent_data target_link_libraries(blockchain_prune_known_spent_data
PRIVATE PRIVATE
crypto
cncrypto
cryptonote_core cryptonote_core
blockchain_db blockchain_db
oracle oracle
@@ -329,6 +339,8 @@ install(TARGETS blockchain_prune DESTINATION bin)
target_link_libraries(blockchain_prune target_link_libraries(blockchain_prune
PRIVATE PRIVATE
crypto
cncrypto
cryptonote_core cryptonote_core
blockchain_db blockchain_db
oracle oracle
+2 -2
View File
@@ -1495,11 +1495,11 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height,
if (o.target.type() == typeid(txout_to_key)) { if (o.target.type() == typeid(txout_to_key)) {
txout_to_key out = boost::get<txout_to_key>(o.target); txout_to_key out = boost::get<txout_to_key>(o.target);
CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output"); CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output");
outputs[out.key] = {out.asset_type, o.amount, out.unlock_time}; outputs[out.key] = std::make_tuple(out.asset_type, o.amount, out.unlock_time);
} else if (o.target.type() == typeid(txout_to_tagged_key)) { } else if (o.target.type() == typeid(txout_to_tagged_key)) {
txout_to_tagged_key out = boost::get<txout_to_tagged_key>(o.target); txout_to_tagged_key out = boost::get<txout_to_tagged_key>(o.target);
CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output"); CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output");
outputs[out.key] = {out.asset_type, o.amount, out.unlock_time}; outputs[out.key] = std::make_tuple(out.asset_type, o.amount, out.unlock_time);
} else { } else {
MERROR("Block at height: " << height << " attempting to add protocol transaction with invalid type " << o.target.type().name()); MERROR("Block at height: " << height << " attempting to add protocol transaction with invalid type " << o.target.type().name());
return false; return false;
@@ -480,6 +480,7 @@ static void set_tx_inputs(
offsets.emplace_back(e.first); offsets.emplace_back(e.first);
unsigned_tx.vin[i] = cryptonote::txin_to_key{ unsigned_tx.vin[i] = cryptonote::txin_to_key{
.amount = 0, .amount = 0,
.asset_type = sources[i].asset_type,
.key_offsets = cryptonote::absolute_output_offsets_to_relative(offsets), .key_offsets = cryptonote::absolute_output_offsets_to_relative(offsets),
.k_image = rct::rct2ki(sources[i].multisig_kLRki.ki), .k_image = rct::rct2ki(sources[i].multisig_kLRki.ki),
}; };
+2 -2
View File
@@ -2491,7 +2491,7 @@ bool simple_wallet::show_qr_code(const std::vector<std::string> &args)
WTEXTON(); WTEXTON();
try try
{ {
const std::string address = "monero:" + m_wallet->get_subaddress_as_str({m_current_subaddress_account, subaddress_index}); const std::string address = "salvium:" + m_wallet->get_subaddress_as_str({m_current_subaddress_account, subaddress_index});
const qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(address.c_str(), qrcodegen::QrCode::Ecc::LOW); const qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(address.c_str(), qrcodegen::QrCode::Ecc::LOW);
for (int y = -2; y < qr.getSize() + 2; y+=2) for (int y = -2; y < qr.getSize() + 2; y+=2)
{ {
@@ -6874,7 +6874,7 @@ bool simple_wallet::transfer_main(
} }
else else
{ {
if (boost::starts_with(local_args[i], "monero:")) if (boost::starts_with(local_args[i], "salvium:"))
fail_msg_writer() << tr("Invalid last argument: ") << local_args.back() << ": " << error; fail_msg_writer() << tr("Invalid last argument: ") << local_args.back() << ": " << error;
else else
fail_msg_writer() << tr("Invalid last argument: ") << local_args.back(); fail_msg_writer() << tr("Invalid last argument: ") << local_args.back();
+3 -3
View File
@@ -14582,7 +14582,7 @@ std::string wallet2::make_uri(const std::string &address, const std::string &pay
return std::string(); return std::string();
} }
std::string uri = "monero:" + address; std::string uri = "salvium:" + address;
unsigned int n_fields = 0; unsigned int n_fields = 0;
if (!payment_id.empty()) if (!payment_id.empty())
@@ -14611,9 +14611,9 @@ std::string wallet2::make_uri(const std::string &address, const std::string &pay
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
bool wallet2::parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error) bool wallet2::parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error)
{ {
if (uri.substr(0, 7) != "monero:") if (uri.substr(0, 7) != "salvium:")
{ {
error = std::string("URI has wrong scheme (expected \"monero:\"): ") + uri; error = std::string("URI has wrong scheme (expected \"salvium:\"): ") + uri;
return false; return false;
} }