forked from lthn/blockchain
Merge branch 'develop' into timesync
This commit is contained in:
commit
7a1f1f7426
10 changed files with 37 additions and 20 deletions
|
|
@ -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"
|
||||
|
|
@ -134,7 +136,13 @@ namespace tools
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -19,7 +19,7 @@ export class VariablesService {
|
|||
public defaultCurrency = 'ZANO';
|
||||
public opening_wallet: Wallet;
|
||||
public exp_med_ts = 0;
|
||||
public ts_diff = 0;
|
||||
public net_time_delta_median = 0;
|
||||
public height_app = 0;
|
||||
public last_build_available = '';
|
||||
public last_build_displaymode = 0;
|
||||
|
|
@ -77,7 +77,6 @@ export class VariablesService {
|
|||
setExpMedTs(timestamp: number) {
|
||||
if (timestamp !== this.exp_med_ts) {
|
||||
this.exp_med_ts = timestamp;
|
||||
this.ts_diff = Math.abs(new Date().getTime() - (timestamp * 1000));
|
||||
this.getExpMedTsEvent.next(timestamp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
console.log(data);
|
||||
// this.variablesService.exp_med_ts = data['expiration_median_timestamp'] + 600 + 1;
|
||||
this.variablesService.setExpMedTs(data['expiration_median_timestamp'] + 600 + 1);
|
||||
this.variablesService.net_time_delta_median = data.net_time_delta_median;
|
||||
this.variablesService.last_build_available = data.last_build_available;
|
||||
this.variablesService.last_build_displaymode = data.last_build_displaymode;
|
||||
this.variablesService.setHeightApp(data.height);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
<i class="icon update critical" tooltip="{{ 'SIDEBAR.UPDATE.CRITICAL_TOOLTIP' | translate }}" placement="right-bottom" tooltipClass="update-tooltip critical" [delay]="500"></i>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="update-container" *ngIf="false">
|
||||
<div class="update-container" *ngIf="variablesService.daemon_state === 2 && variablesService.net_time_delta_median !== 0">
|
||||
<div class="update-text time">
|
||||
<span>{{ 'SIDEBAR.UPDATE.TIME' | translate }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
getUpdate() {
|
||||
this.backend.openUrlInBrowser('docs.zano.org/docs/zano-wallet');
|
||||
this.backend.openUrlInBrowser('zano.org/downloads.html');
|
||||
}
|
||||
|
||||
logOut() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
#define BUILD_COMMIT_ID "@VERSION@"
|
||||
#define PROJECT_VERSION "1.0"
|
||||
#define PROJECT_VERSION_BUILD_NO 38
|
||||
#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 "]"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue