1
0
Fork 0
forked from lthn/blockchain

Merge remote-tracking branch 'origin/develop' into frontend

# Conflicts:
#	src/gui/qt-daemon/html/main.js.map
This commit is contained in:
wildkif 2019-06-11 13:13:38 +03:00
commit 3d94ec9bd3
13 changed files with 66 additions and 22 deletions

View file

@ -126,7 +126,8 @@ namespace epee
t_result result_struct = AUTO_VAL_INIT(result_struct);
if( code <=0 )
{
LOG_PRINT_L1("Failed to invoke command " << command << " return code " << code << "(" << epee::levin::get_err_descr(code) << ")");
LOG_PRINT_L2("BACKTRACE: " << ENDL << epee::misc_utils::print_trace());
LOG_PRINT_L1("Failed to invoke command " << command << " return code " << code << "(" << epee::levin::get_err_descr(code) << ")context:" << print_connection_context(context));
TRY_ENTRY()
cb(code, result_struct, context);
CATCH_ENTRY2(true)
@ -149,7 +150,8 @@ namespace epee
}, inv_timeout);
if( res <=0 )
{
LOG_PRINT_L1("Failed to invoke command " << command << " return code " << res << "(" << epee::levin::get_err_descr(res)<< ")");
LOG_PRINT_L2("BACKTRACE: " << ENDL << epee::misc_utils::print_trace());
LOG_PRINT_L1("Failed to invoke command " << command << " return code " << res << "(" << epee::levin::get_err_descr(res) << ") conn_id=" << conn_id);
return false;
}
return true;

View file

@ -11,6 +11,8 @@
#define BUF_SIZE 1024
#define CHECK_AND_ASSERT_MESS_LMDB_DB(rc, ret, mess) CHECK_AND_ASSERT_MES(res == MDB_SUCCESS, ret, "[DB ERROR]:(" << rc << ")" << mdb_strerror(rc) << ", [message]: " << mess);
#define CHECK_AND_ASSERT_THROW_MESS_LMDB_DB(rc, mess) CHECK_AND_ASSERT_THROW_MES(res == MDB_SUCCESS, "[DB ERROR]:(" << rc << ")" << mdb_strerror(rc) << ", [message]: " << mess);
#define ASSERT_MES_AND_THROW_LMDB(rc, mess) ASSERT_MES_AND_THROW("[DB ERROR]:(" << rc << ")" << mdb_strerror(rc) << ", [message]: " << mess);
#undef LOG_DEFAULT_CHANNEL
#define LOG_DEFAULT_CHANNEL "lmdb"
@ -108,8 +110,12 @@ namespace tools
transactions_list& rtxlist = m_txs[std::this_thread::get_id()];
MDB_txn* pparent_tx = nullptr;
MDB_txn* p_new_tx = nullptr;
bool parent_read_only = false;
if (rtxlist.size())
{
pparent_tx = rtxlist.back().ptx;
parent_read_only = rtxlist.back().read_only;
}
if (pparent_tx && read_only)
@ -123,9 +129,20 @@ namespace tools
if (read_only)
flags += MDB_RDONLY;
//don't use parent tx in write transactions if parent tx was read-only (restriction in lmdb)
//see "Nested transactions: Max 1 child, write txns only, no writemap"
if (pparent_tx && parent_read_only)
pparent_tx = nullptr;
CHECK_AND_ASSERT_THROW_MES(m_penv, "m_penv==null, db closed");
res = mdb_txn_begin(m_penv, pparent_tx, flags, &p_new_tx);
CHECK_AND_ASSERT_MESS_LMDB_DB(res, false, "Unable to mdb_txn_begin");
if(res != MDB_SUCCESS)
{
//Important: if mdb_txn_begin is failed need to unlock previously locked mutex
CRITICAL_SECTION_UNLOCK(m_write_exclusive_lock);
//throw exception to avoid regular code execution
ASSERT_MES_AND_THROW_LMDB(res, "Unable to mdb_txn_begin");
}
rtxlist.push_back(tx_entry());
rtxlist.back().count = read_only ? 1 : 0;

View file

@ -5210,7 +5210,10 @@ bool blockchain_storage::validate_alt_block_input(const transaction& input_tx, s
// TODO: consider checking p->tx for unlock time validity as it's checked in get_output_keys_for_input_with_checks()
// make sure it was actually found
CHECK_AND_ASSERT_MES(pk != null_pkey, false, "Can't determine output public key for offset " << pk_n);
// let's disable this check due to missing equal check in main chain validation code
//TODO: implement more strict validation with next hard fork
//CHECK_AND_ASSERT_MES(pk != null_pkey, false, "Can't determine output public key for offset " << pk_n << " in related tx: " << tx_id << ", out_n = " << out_n);
pub_key_pointers.push_back(&pk);
}

View file

@ -1565,18 +1565,18 @@ void daemon_backend::wallet_vs_options::worker_func()
catch (const std::exception& e)
{
LOG_PRINT_L0(w->get()->get_log_prefix() + "Failed to refresh wallet: " << e.what());
LOG_ERROR(w->get()->get_log_prefix() + " Exception in wallet handler: " << e.what());
wallet_state = wsi.wallet_state = view::wallet_status_info::wallet_state_error;
pview->update_wallet_status(wsi);
return;
continue;
}
catch (...)
{
LOG_PRINT_L0(w->get()->get_log_prefix() + "Failed to refresh wallet, unknownk exception");
LOG_ERROR(w->get()->get_log_prefix() + " Exception in wallet handler: unknownk exception");
wallet_state = wsi.wallet_state = view::wallet_status_info::wallet_state_error;
pview->update_wallet_status(wsi);
return;
continue;
}
boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
}

View file

@ -6424,7 +6424,7 @@ var SidebarComponent = /** @class */ (function () {
});
};
SidebarComponent.prototype.getUpdate = function () {
this.backend.openUrlInBrowser('docs.zano.org/docs/zano-wallet');
this.backend.openUrlInBrowser('zano.org/downloads.html');
};
SidebarComponent.prototype.logOut = function () {
var _this = this;

File diff suppressed because one or more lines are too long

View file

@ -1534,14 +1534,22 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
if (!command_line::has_arg(vm, arg_password) )
tools::password_container pwd_container;
if (command_line::has_arg(vm, arg_password))
{
LOG_ERROR("Wallet password is not set.");
return EXIT_FAILURE;
pwd_container.password(command_line::get_arg(vm, arg_password));
}
else
{
bool r = pwd_container.read_password();
if (!r)
{
LOG_ERROR("failed to read wallet password");
return EXIT_FAILURE;
}
}
std::string wallet_file = command_line::get_arg(vm, arg_wallet_file);
std::string wallet_password = command_line::get_arg(vm, arg_password);
std::string daemon_address = command_line::get_arg(vm, arg_daemon_address);
std::string daemon_host = command_line::get_arg(vm, arg_daemon_host);
int daemon_port = command_line::get_arg(vm, arg_daemon_port);
@ -1559,7 +1567,7 @@ int main(int argc, char* argv[])
try
{
LOG_PRINT_L0("Loading wallet...");
wal.load(epee::string_encoding::convert_to_unicode(wallet_file), wallet_password);
wal.load(epee::string_encoding::convert_to_unicode(wallet_file), pwd_container.password());
}
catch (const tools::error::wallet_load_notice_wallet_restored& e)
{
@ -1621,7 +1629,8 @@ int main(int argc, char* argv[])
LOG_ERROR("Failed to store wallet: " << e.what());
return EXIT_FAILURE;
}
}else
}
else // if(command_line::has_arg(vm, tools::wallet_rpc_server::arg_rpc_bind_port))
{
//runs wallet with console interface
sw->set_offline_mode(offline_mode);

View file

@ -36,7 +36,7 @@ namespace
#define VDIFF_TARGET_MAX_DEFAULT 100000000000ull // = 100 Gh
#define VDIFF_TARGET_TIME_DEFAULT 30 // sec
#define VDIFF_RETARGET_TIME_DEFAULT 240 // sec
#define VDIFF_RETARGET_SHARES_COUNT 12 // enforce retargeting if this many shares are be received (huge performace comparing to current difficulty)
#define VDIFF_RETARGET_SHARES_COUNT 12 // enforce retargeting if this many shares are received (high performace in terms of current difficulty)
#define VDIFF_VARIANCE_PERCENT_DEFAULT 25 // %
const command_line::arg_descriptor<bool> arg_stratum = {"stratum", "Stratum server: enable" };
@ -57,7 +57,7 @@ namespace
const command_line::arg_descriptor<uint64_t> arg_stratum_vdiff_retarget_time = {"stratum-vdiff-retarget-time", "Stratum server: check to see if we should retarget this often (sec.)", VDIFF_RETARGET_TIME_DEFAULT };
const command_line::arg_descriptor<uint64_t> arg_stratum_vdiff_retarget_shares = {"stratum-vdiff-retarget-shares", "Stratum server: enforce retargeting if got this many shares", VDIFF_RETARGET_SHARES_COUNT };
const command_line::arg_descriptor<uint64_t> arg_stratum_vdiff_variance_percent = {"stratum-vdiff-variance-percent", "Stratum server: allow average time to very this % from target without retarget", VDIFF_VARIANCE_PERCENT_DEFAULT };
const command_line::arg_descriptor<bool> arg_stratum_always_online = { "stratum-always-online", "Stratum server consider core as always online, useful for debugging with --offline-mode" };
const command_line::arg_descriptor<bool> arg_stratum_always_online = { "stratum-always-online", "Stratum server consider the core being synchronized regardless of online status, useful for debugging with --offline-mode" };
//==============================================================================================================================
@ -80,7 +80,7 @@ namespace
#define HR_TO_STREAM_IN_MHS_3P(hr) std::fixed << std::setprecision(3) << hr / 1000000.0
// debug stuff
#define DBG_NETWORK_DIFFICULTY 0 // if non-zero: use this value as net difficulty when checking shares (useful for debugging on testnet, recommended value is 160000000000ull)
#define DBG_NETWORK_DIFFICULTY 0 // if non-zero: use this value as net difficulty when checking shares (useful for debugging on testnet, recommended value is 1600000000ull)
#define DBG_CORE_ALWAYS_SYNCRONIZED 0 // if set to 1: allows the server to start even if the core is not syncronized, useful for debugging with --offline-mode
#define STRINGIZE_DETAIL(x) #x
#define STRINGIZE(x) STRINGIZE_DETAIL(x)

View file

@ -2,6 +2,6 @@
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.0"
#define PROJECT_VERSION_BUILD_NO 34
#define PROJECT_VERSION_BUILD_NO 39
#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 "]"

View file

@ -12,10 +12,12 @@ ARCHIVE_NAME_PREFIX=zano-macos-x64-
if [ -n "$build_prefix" ]; then
ARCHIVE_NAME_PREFIX=${ARCHIVE_NAME_PREFIX}${build_prefix}-
build_prefix_label="$build_prefix "
fi
if [ -n "$testnet" ]; then
testnet_def="-D TESTNET=TRUE"
testnet_label="testnet "
ARCHIVE_NAME_PREFIX=${ARCHIVE_NAME_PREFIX}testnet-
fi

View file

@ -0,0 +1,7 @@
call configure_local_paths.cmd
cd ..
@mkdir build_msvc2017_64_tn
cd build_msvc2017_64_tn
cmake -D TESTNET=TRUE -D USE_PCH=TRUE -D BUILD_TESTS=TRUE -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2017_64 -D BUILD_GUI=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -T host=x64 ".."

View file

@ -27,6 +27,8 @@ function fix_boost_libs_in_binary() # $1 - path to boost libs, $2 - binary to fi
install_name_tool -change libboost_atomic.dylib $1/libboost_atomic.dylib $2
install_name_tool -change libboost_program_options.dylib $1/libboost_program_options.dylib $2
install_name_tool -change libboost_locale.dylib $1/libboost_locale.dylib $2
install_name_tool -change libboost_timer.dylib $1/libboost_timer.dylib $2
install_name_tool -change libboost_chrono.dylib $1/libboost_chrono.dylib $2
return 0
}
@ -35,6 +37,8 @@ function fix_boost_libs_in_libs() # $1 - path to boost libs, $2 - path to libs f
install_name_tool -change libboost_system.dylib $1/libboost_system.dylib $2/libboost_filesystem.dylib
install_name_tool -change libboost_system.dylib $1/libboost_system.dylib $2/libboost_thread.dylib
install_name_tool -change libboost_system.dylib $1/libboost_system.dylib $2/libboost_chrono.dylib
install_name_tool -change libboost_system.dylib $1/libboost_system.dylib $2/libboost_timer.dylib
install_name_tool -change libboost_chrono.dylib $1/libboost_chrono.dylib $2/libboost_timer.dylib
install_name_tool -change libboost_system.dylib $1/libboost_system.dylib $2/libboost_locale.dylib
}

View file

@ -2,10 +2,10 @@
"maj":1,
"min":0,
"rev":0,
"build":26,
"build":37,
"cs":[
{
"build":28,
"build":37,
"mode":3
}
]