forked from lthn/blockchain
Merge branch 'develop' into release
This commit is contained in:
commit
4abcd167ba
19 changed files with 157 additions and 39 deletions
|
|
@ -3,6 +3,13 @@ cmake_minimum_required(VERSION 3.5)
|
|||
PROJECT(Zano)
|
||||
|
||||
|
||||
message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
|
||||
message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}")
|
||||
message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}")
|
||||
|
||||
|
||||
|
||||
|
||||
set(VERSION "1.0")
|
||||
|
||||
if(POLICY CMP0043)
|
||||
|
|
@ -59,7 +66,7 @@ find_package(OpenSSL REQUIRED)
|
|||
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
|
||||
endif()
|
||||
|
||||
set(USE_PCH FALSE CACHE BOOL "Use shared precompiled headers")
|
||||
|
|
@ -101,6 +108,10 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|||
set(CLANG TRUE)
|
||||
endif()
|
||||
|
||||
|
||||
add_definitions("/DBOOST_NO_CXX98_FUNCTION_BASE")
|
||||
|
||||
|
||||
if(MSVC)
|
||||
add_definitions("/D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0")
|
||||
add_compile_options(/bigobj /Zm1000 /Z7 /MP2 /W3 /GS- /wd4996 /wd4503 /wd4345 /wd4091 /FIinline_c.h)
|
||||
|
|
@ -210,10 +221,11 @@ endif()
|
|||
|
||||
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 12.00)
|
||||
set(Boost_LIBRARIES "libboost.a")
|
||||
#workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator)
|
||||
set(__iphoneos_archs "armv7 armv7s arm64")
|
||||
set(__iphonesimulator_archs "i386 x86_64")
|
||||
set(__iphoneos_archs "arm64")
|
||||
set(__iphonesimulator_archs "x86_64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
|
||||
|
|
|
|||
|
|
@ -280,6 +280,8 @@ namespace tools
|
|||
template<class t_pod_key, class t_object>
|
||||
bool get_t_object(container_handle h, const t_pod_key& k, t_object& obj) const
|
||||
{
|
||||
if (!m_is_open)
|
||||
return false;
|
||||
performance_data& m_performance_data = m_gperformance_data;
|
||||
//TRY_ENTRY();
|
||||
std::string res_buff;
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ namespace crypto
|
|||
explicit scalar_t(const boost::multiprecision::number<T>& bigint)
|
||||
{
|
||||
zero();
|
||||
unsigned int bytes_to_copy = bigint.backend().size() * bigint.backend().limb_bits / 8;
|
||||
size_t bytes_to_copy = bigint.backend().size() * bigint.backend().limb_bits / 8;
|
||||
if (bytes_to_copy > sizeof *this)
|
||||
bytes_to_copy = sizeof *this;
|
||||
memcpy(&m_s[0], bigint.backend().limbs(), bytes_to_copy);
|
||||
|
|
|
|||
|
|
@ -250,8 +250,8 @@
|
|||
#define BC_OFFERS_CURRENCY_MARKET_FILENAME "market.bin"
|
||||
|
||||
#ifndef TESTNET
|
||||
#define WALLET_FILE_SERIALIZATION_VERSION 162
|
||||
#define WALLET_FILE_LAST_SUPPORTED_VERSION 162
|
||||
#define WALLET_FILE_SERIALIZATION_VERSION 163
|
||||
#define WALLET_FILE_LAST_SUPPORTED_VERSION 163
|
||||
#else
|
||||
#define WALLET_FILE_LAST_SUPPORTED_VERSION (CURRENCY_FORMATION_VERSION+76)
|
||||
#define WALLET_FILE_SERIALIZATION_VERSION (CURRENCY_FORMATION_VERSION+76)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "include_base_utils.h"
|
||||
#include <boost/foreach.hpp>
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
#include <boost/locale.hpp>
|
||||
#endif
|
||||
using namespace epee;
|
||||
|
|
@ -1577,6 +1577,11 @@ namespace currency
|
|||
crypto::chacha_crypt(derivation_local, m_acc_keys.spend_secret_key);
|
||||
}
|
||||
else {
|
||||
if (m_acc_keys.spend_secret_key == currency::null_skey)
|
||||
{
|
||||
//tracking wallet, invisible
|
||||
return;
|
||||
}
|
||||
CHECK_AND_ASSERT_THROW_MES(m_acc_keys.spend_secret_key != currency::null_skey && m_tx_onetime_pubkey != currency::null_pkey, "tx_service_attachment with TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE: keys uninitialized");
|
||||
bool r = crypto::generate_key_derivation(m_tx_onetime_pubkey, m_acc_keys.spend_secret_key, derivation_local);
|
||||
CHECK_AND_ASSERT_THROW_MES(r, "Failed to generate_key_derivation at TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE");
|
||||
|
|
@ -1687,6 +1692,11 @@ namespace currency
|
|||
//no crypt info in tx
|
||||
return null_derivation;
|
||||
}
|
||||
if (acc_keys.spend_secret_key == currency::null_skey)
|
||||
{
|
||||
//traceable wallet and outgoing transfer - skip
|
||||
return null_derivation;
|
||||
}
|
||||
|
||||
derivation = crypto_info.encrypted_key_derivation;
|
||||
crypto::chacha_crypt(derivation, acc_keys.spend_secret_key);
|
||||
|
|
@ -4394,7 +4404,7 @@ namespace currency
|
|||
return o << "<" << r.n << ":" << r.tx_id << ">";
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
const std::locale& utf8_get_conversion_locale()
|
||||
{
|
||||
static std::locale loc = boost::locale::generator().generate("en_US.UTF-8");
|
||||
|
|
|
|||
|
|
@ -930,7 +930,7 @@ namespace currency
|
|||
//---------------------------------------------------------------
|
||||
std::ostream& operator <<(std::ostream& o, const ref_by_id& r);
|
||||
//---------------------------------------------------------------
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
std::string utf8_to_upper(const std::string& s);
|
||||
std::string utf8_to_lower(const std::string& s);
|
||||
bool utf8_substring_test_case_insensitive(const std::string& match, const std::string& s); // Returns true is 's' contains 'match' (case-insensitive)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace bc_services
|
|||
//------------------------------------------------------------------
|
||||
bool order_offers_by_name(const offer_details_ex* a, const offer_details_ex* b)
|
||||
{
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
return currency::utf8_to_lower(a->target) < currency::utf8_to_lower(b->target);
|
||||
#else
|
||||
return false;
|
||||
|
|
@ -150,7 +150,7 @@ namespace bc_services
|
|||
//check category
|
||||
if (!of.category.empty() && o.category.find(of.category) == std::string::npos)
|
||||
return false;
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
//check target condition
|
||||
if (of.target.size() && !currency::utf8_substring_test_case_insensitive(of.target, o.target))
|
||||
return false;
|
||||
|
|
@ -173,7 +173,7 @@ namespace bc_services
|
|||
//check target condition
|
||||
if (of.location_country.size() && (of.location_country != o.location_country))
|
||||
return false;
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
//check target condition
|
||||
if (of.location_city.size() && !currency::utf8_substring_test_case_insensitive(of.location_city, o.location_city))
|
||||
return false;
|
||||
|
|
@ -221,7 +221,7 @@ namespace bc_services
|
|||
//--------------------------------------------------------------------------------
|
||||
bool filter_offers_list(std::list<bc_services::offer_details_ex>& offers, const bc_services::core_offers_filter& filter, uint64_t current_core_time)
|
||||
{
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
//filter
|
||||
offers.remove_if([&](bc_services::offer_details_ex& o) -> bool {
|
||||
return !is_offer_matched_by_filter(o, filter, current_core_time);
|
||||
|
|
|
|||
|
|
@ -193,14 +193,14 @@ namespace bc_services
|
|||
inline std::string extract_contacts(const odeh& v) { return v.contacts; }
|
||||
inline std::string extract_location(const odeh& v) {
|
||||
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
return currency::utf8_to_lower(v.location_country + v.location_city);
|
||||
#else
|
||||
return "UNSUPORTED";
|
||||
#endif
|
||||
}
|
||||
inline std::string extract_name(const odeh& v) {
|
||||
#ifndef ANDROID_BUILD
|
||||
#ifndef MOBILE_WALLET_BUILD
|
||||
return currency::utf8_to_lower(v.target);
|
||||
#else
|
||||
return "UNSUPORTED";
|
||||
|
|
|
|||
|
|
@ -272,13 +272,23 @@ QString MainWindow::request_dummy()
|
|||
QString MainWindow::call_rpc(const QString& params)
|
||||
{
|
||||
TRY_ENTRY();
|
||||
|
||||
if (!m_backend.is_core_initialized())
|
||||
{
|
||||
epee::json_rpc::error_response rsp;
|
||||
rsp.jsonrpc = "2.0";
|
||||
rsp.error.code = -1;
|
||||
rsp.error.message = API_RETURN_CODE_CORE_BUSY;
|
||||
return QString::fromStdString(epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(rsp)));
|
||||
}
|
||||
|
||||
epee::net_utils::http::http_request_info query_info = AUTO_VAL_INIT(query_info);
|
||||
epee::net_utils::http::http_response_info response_info = AUTO_VAL_INIT(response_info);
|
||||
currency::core_rpc_server::connection_context dummy_context = AUTO_VAL_INIT(dummy_context);
|
||||
|
||||
query_info.m_URI = "/json_rpc";
|
||||
query_info.m_body = params.toStdString();
|
||||
|
||||
|
||||
m_backend.get_rpc_server().handle_http_request(query_info, response_info, dummy_context);
|
||||
if (response_info.m_response_code != 200)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit f040b10090a0246ee5f68a37bb4fcc13e6abebcc
|
||||
Subproject commit f8e9556fbaccd49841ce91afc3c90c8e3142ac95
|
||||
|
|
@ -359,15 +359,33 @@ namespace currency
|
|||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_random_outs(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res, connection_context& cntx)
|
||||
bool core_rpc_server::on_get_random_outs(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY::response& res, connection_context& cntx)
|
||||
{
|
||||
CHECK_CORE_READY();
|
||||
res.status = API_RETURN_CODE_FAIL;
|
||||
if(!m_core.get_random_outs_for_amounts(req, res))
|
||||
|
||||
COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request req_native = AUTO_VAL_INIT(req_native);
|
||||
req_native.amounts = req.amounts;
|
||||
req_native.decoys_count = req.outs_count;
|
||||
req_native.use_forced_mix_outs = req.use_forced_mix_outs;
|
||||
COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response res_native = AUTO_VAL_INIT(res_native);
|
||||
|
||||
if(!m_core.get_random_outs_for_amounts(req_native, res_native))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const auto& item : res_native.outs)
|
||||
{
|
||||
res.outs.push_back(COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY::outs_for_amount());
|
||||
res.outs.back().amount = item.amount;
|
||||
for (const auto& subitem : item.outs)
|
||||
{
|
||||
res.outs.back().outs.push_back(COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY::out_entry { subitem.global_amount_index, subitem.stealth_address });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
res.status = API_RETURN_CODE_OK;
|
||||
|
||||
/*
|
||||
|
|
@ -390,6 +408,22 @@ namespace currency
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_random_outs1(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res, connection_context& cntx)
|
||||
{
|
||||
CHECK_CORE_READY();
|
||||
res.status = API_RETURN_CODE_FAIL;
|
||||
|
||||
if(!m_core.get_random_outs_for_amounts(req, res))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
res.status = API_RETURN_CODE_OK;
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_random_outs2(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::response& res, connection_context& cntx)
|
||||
{
|
||||
CHECK_CORE_READY();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ namespace currency
|
|||
bool on_send_raw_tx(const COMMAND_RPC_SEND_RAW_TX::request& req, COMMAND_RPC_SEND_RAW_TX::response& res, connection_context& cntx);
|
||||
bool on_start_mining(const COMMAND_RPC_START_MINING::request& req, COMMAND_RPC_START_MINING::response& res, connection_context& cntx);
|
||||
bool on_stop_mining(const COMMAND_RPC_STOP_MINING::request& req, COMMAND_RPC_STOP_MINING::response& res, connection_context& cntx);
|
||||
bool on_get_random_outs(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res, connection_context& cntx);
|
||||
bool on_get_random_outs(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY::response& res, connection_context& cntx);
|
||||
bool on_get_random_outs1(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res, connection_context& cntx);
|
||||
bool on_get_random_outs2(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::response& res, connection_context& cntx);
|
||||
bool on_get_info(const COMMAND_RPC_GET_INFO::request& req, COMMAND_RPC_GET_INFO::response& res, connection_context& cntx);
|
||||
bool on_set_maintainers_info(const COMMAND_RPC_SET_MAINTAINERS_INFO::request& req, COMMAND_RPC_SET_MAINTAINERS_INFO::response& res, connection_context& cntx);
|
||||
|
|
@ -109,7 +110,8 @@ namespace currency
|
|||
// binary RPCs
|
||||
MAP_URI_AUTO_BIN2("/getblocks.bin", on_get_blocks, COMMAND_RPC_GET_BLOCKS_FAST)
|
||||
MAP_URI_AUTO_BIN2("/get_o_indexes.bin", on_get_indexes, COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES)
|
||||
MAP_URI_AUTO_BIN2("/getrandom_outs.bin", on_get_random_outs, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS)
|
||||
MAP_URI_AUTO_BIN2("/getrandom_outs.bin", on_get_random_outs, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY)
|
||||
MAP_URI_AUTO_BIN2("/getrandom_outs1.bin", on_get_random_outs1, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS)
|
||||
MAP_URI_AUTO_BIN2("/getrandom_outs2.bin", on_get_random_outs2, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2)
|
||||
MAP_URI_AUTO_BIN2("/set_maintainers_info.bin", on_set_maintainers_info, COMMAND_RPC_SET_MAINTAINERS_INFO)
|
||||
MAP_URI_AUTO_BIN2("/get_tx_pool.bin", on_get_tx_pool, COMMAND_RPC_GET_TX_POOL)
|
||||
|
|
@ -142,7 +144,8 @@ namespace currency
|
|||
MAP_JON_RPC ("get_pool_txs_brief_details", on_get_pool_txs_brief_details, COMMAND_RPC_GET_POOL_TXS_BRIEF_DETAILS)
|
||||
MAP_JON_RPC ("get_all_pool_tx_list", on_get_all_pool_tx_list, COMMAND_RPC_GET_ALL_POOL_TX_LIST)
|
||||
MAP_JON_RPC ("get_pool_info", on_get_pool_info, COMMAND_RPC_GET_POOL_INFO)
|
||||
MAP_JON_RPC ("getrandom_outs", on_get_random_outs, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS)
|
||||
MAP_JON_RPC ("getrandom_outs", on_get_random_outs, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY)
|
||||
MAP_JON_RPC ("getrandom_outs1", on_get_random_outs1, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS)
|
||||
MAP_JON_RPC ("getrandom_outs2", on_get_random_outs2, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2)
|
||||
MAP_JON_RPC ("get_votes", on_get_votes, COMMAND_RPC_GET_VOTES)
|
||||
//assets api
|
||||
|
|
|
|||
|
|
@ -421,8 +421,6 @@ namespace currency
|
|||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------
|
||||
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2
|
||||
{
|
||||
|
|
@ -457,6 +455,51 @@ namespace currency
|
|||
typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response response;
|
||||
};
|
||||
|
||||
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_LEGACY
|
||||
{
|
||||
struct request
|
||||
{
|
||||
std::list<uint64_t> amounts;
|
||||
uint64_t outs_count;
|
||||
bool use_forced_mix_outs;
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(amounts)
|
||||
KV_SERIALIZE(outs_count)
|
||||
KV_SERIALIZE(use_forced_mix_outs)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct out_entry
|
||||
{
|
||||
uint64_t global_amount_index;
|
||||
crypto::public_key out_key;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct outs_for_amount
|
||||
{
|
||||
uint64_t amount;
|
||||
std::list<out_entry> outs;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(amount)
|
||||
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(outs)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
struct response
|
||||
{
|
||||
std::vector<outs_for_amount> outs;
|
||||
std::string status;
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(outs)
|
||||
KV_SERIALIZE(status)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------
|
||||
struct COMMAND_RPC_SET_MAINTAINERS_INFO
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
#define PROJECT_REVISION "0"
|
||||
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
|
||||
|
||||
#define PROJECT_VERSION_BUILD_NO 266
|
||||
#define PROJECT_VERSION_BUILD_NO 271
|
||||
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
|
||||
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ namespace tools
|
|||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool default_http_core_proxy::call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(const currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res)
|
||||
{
|
||||
return invoke_http_bin_remote_command2_update_is_disconnect("/getrandom_outs.bin", req, res);
|
||||
return invoke_http_bin_remote_command2_update_is_disconnect("/getrandom_outs1.bin", req, res);
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool default_http_core_proxy::call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2(const currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::request& req, currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::response& res)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace tools
|
|||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(const currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res) override
|
||||
{
|
||||
return m_rpc.on_get_random_outs(req, res, m_cntxt_stub);
|
||||
return m_rpc.on_get_random_outs1(req, res, m_cntxt_stub);
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2(const currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::request& req, currency::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2::response& res) override
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ using namespace epee;
|
|||
#include "common/encryption_filter.h"
|
||||
#include "crypto/bitcoin/sha256_helper.h"
|
||||
|
||||
#define DISABLE_TOR
|
||||
#ifndef DISABLE_TOR
|
||||
# define DISABLE_TOR
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_TOR
|
||||
#include "common/tor_helper.h"
|
||||
|
|
@ -4259,8 +4261,8 @@ bool wallet2::prepare_and_sign_pos_block(const mining_context& cxt, uint64_t ful
|
|||
|
||||
r = m_core_proxy->call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(decoys_req, decoys_resp);
|
||||
// TODO @#@# do we need these exceptions?
|
||||
THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(decoys_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs1.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(decoys_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs1.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(decoys_resp.status == API_RETURN_CODE_OK, error::get_random_outs_error, decoys_resp.status);
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(decoys_resp.outs.size() == 1, "got wrong number of decoys batches: " << decoys_resp.outs.size());
|
||||
|
||||
|
|
@ -4369,8 +4371,8 @@ bool wallet2::prepare_and_sign_pos_block(const mining_context& cxt, uint64_t ful
|
|||
|
||||
r = m_core_proxy->call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(decoys_req, decoys_resp);
|
||||
// TODO @#@# do we need these exceptions?
|
||||
THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(decoys_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs1.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(decoys_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs1.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(decoys_resp.status == API_RETURN_CODE_OK, error::get_random_outs_error, decoys_resp.status);
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(decoys_resp.outs.size() == 1, "got wrong number of decoys batches: " << decoys_resp.outs.size());
|
||||
WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(decoys_resp.outs[0].outs.size() == required_decoys_count + 1, "for PoS stake tx got less decoys to mix than requested: " << decoys_resp.outs[0].outs.size() << " < " << required_decoys_count + 1);
|
||||
|
|
@ -6050,13 +6052,13 @@ bool wallet2::prepare_tx_sources(size_t fake_outputs_count_, std::vector<currenc
|
|||
else
|
||||
{
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(daemon_resp.outs.size() == selected_indicies.size(),
|
||||
"unable to exacute getrandom_outs.bin after 10 attempts with code API_RETURN_CODE_FAIL, there must be problems with mixins");
|
||||
"unable to exacute getrandom_outs2.bin after 10 attempts with code API_RETURN_CODE_FAIL, there must be problems with mixins");
|
||||
}
|
||||
}
|
||||
THROW_IF_FALSE_WALLET_EX(daemon_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(daemon_resp.status == API_RETURN_CODE_OK, error::get_random_outs_error, daemon_resp.status);
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(daemon_resp.outs.size() == selected_indicies.size(),
|
||||
"daemon returned wrong response for getrandom_outs.bin, wrong amounts count = " << daemon_resp.outs.size() << ", expected: " << selected_indicies.size());
|
||||
"daemon returned wrong response for getrandom_outs2.bin, wrong amounts count = " << daemon_resp.outs.size() << ", expected: " << selected_indicies.size());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -7413,11 +7415,11 @@ void wallet2::sweep_below(size_t fake_outs_count, const currency::account_public
|
|||
|
||||
r = m_core_proxy->call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(req, rpc_get_random_outs_resp);
|
||||
|
||||
THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(rpc_get_random_outs_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs1.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(rpc_get_random_outs_resp.status != API_RETURN_CODE_BUSY, error::daemon_busy, "getrandom_outs1.bin");
|
||||
THROW_IF_FALSE_WALLET_EX(rpc_get_random_outs_resp.status == API_RETURN_CODE_OK, error::get_random_outs_error, rpc_get_random_outs_resp.status);
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(rpc_get_random_outs_resp.outs.size() == selected_transfers.size(),
|
||||
"daemon returned wrong number of amounts for getrandom_outs.bin: " << rpc_get_random_outs_resp.outs.size() << ", requested: " << selected_transfers.size());
|
||||
"daemon returned wrong number of amounts for getrandom_outs1.bin: " << rpc_get_random_outs_resp.outs.size() << ", requested: " << selected_transfers.size());
|
||||
|
||||
std::vector<COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::outs_for_amount> scanty_outs;
|
||||
for (COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::outs_for_amount& amount_outs : rpc_get_random_outs_resp.outs)
|
||||
|
|
|
|||
|
|
@ -506,7 +506,6 @@ bool wallets_manager::init_local_daemon()
|
|||
CHECK_AND_ASSERT_AND_SET_GUI(res, "Failed to initialize core");
|
||||
LOG_PRINT_L0("Core initialized OK");
|
||||
|
||||
|
||||
//check if offers module synchronized with blockchaine storage
|
||||
auto& bcs = m_ccore.get_blockchain_storage();
|
||||
if (!m_offers_service.is_disabled() && bcs.get_current_blockchain_size() > 1 && bcs.get_top_block_id() != m_offers_service.get_last_seen_block_id())
|
||||
|
|
@ -562,6 +561,7 @@ bool wallets_manager::init_local_daemon()
|
|||
CHECK_AND_ASSERT_AND_SET_GUI(res, "Failed to initialize core rpc server.");
|
||||
LOG_PRINT_L0("Core rpc server started ok");
|
||||
|
||||
m_core_initialized = true;
|
||||
LOG_PRINT_L0("Starting p2p net loop...");
|
||||
//dsi.text_state = "Starting network loop";
|
||||
m_pview->update_daemon_status(dsi);
|
||||
|
|
@ -2223,7 +2223,7 @@ void wallets_manager::wallet_vs_options::worker_func()
|
|||
pos_minin_interval.do_call([this](){
|
||||
tools::wallet2::mining_context ctx = AUTO_VAL_INIT(ctx);
|
||||
LOG_PRINT_L1(get_log_prefix() + " Starting PoS mint iteration");
|
||||
if (!w->get()->fill_mining_context(ctx) || ctx.status != API_RETURN_CODE_OK)
|
||||
if (!w->get()->fill_mining_context(ctx))
|
||||
{
|
||||
LOG_PRINT_L1(get_log_prefix() + " cannot obtain PoS mining context, skip iteration");
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ public:
|
|||
bool set_use_tor(bool use_tor);
|
||||
std::string add_custom_asset_id(uint64_t wallet_id, const crypto::public_key& asset_id, currency::asset_descriptor_base& asset_descriptor);
|
||||
std::string delete_custom_asset_id(uint64_t wallet_id, const crypto::public_key& asset_id);
|
||||
bool is_core_initialized() { return m_core_initialized;}
|
||||
|
||||
private:
|
||||
void main_worker(const po::variables_map& vm);
|
||||
|
|
@ -244,6 +245,7 @@ private:
|
|||
// std::atomic<uint64_t> m_last_wallet_synch_height;
|
||||
std::atomic<uint64_t> m_wallet_id_counter;
|
||||
std::atomic<bool> m_dont_save_wallet_at_stop;
|
||||
std::atomic<bool> m_core_initialized = false;
|
||||
|
||||
std::string m_data_dir;
|
||||
view::gui_options m_ui_opt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue