1
0
Fork 0
forked from lthn/blockchain

Merge branch 'ui_develop' into develop

This commit is contained in:
cryptozoidberg 2020-12-03 21:16:21 +01:00
commit 095d0e24fb
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
8 changed files with 40 additions and 3 deletions

View file

@ -3379,6 +3379,12 @@ namespace tools
return wordsArray[n];
}
bool valid_word(const std::string& w)
{
auto it = wordsMap.find(w);
return it != wordsMap.end();
}
uint64_t num_by_word(const std::string& w)
{
auto it = wordsMap.find(w);

View file

@ -46,5 +46,6 @@ namespace tools
std::string binary2text(const std::vector<unsigned char>& binary);
std::string word_by_num(uint32_t n);
uint64_t num_by_word(const std::string& w);
bool valid_word(const std::string& w);
}
}

View file

@ -232,6 +232,13 @@ namespace currency
std::list<std::string> words;
boost::split(words, seed_phrase, boost::is_space());
//let's validate each word
for (const auto& w: words)
{
if (!tools::mnemonic_encoding::valid_word(words))
return false;
}
std::string timestamp_word;
if (words.size() == SEED_PHRASE_V1_WORDS_COUNT)
{

View file

@ -1989,6 +1989,7 @@ QString MainWindow::get_seed_phrase_info(const QString& param)
PREPARE_ARG_FROM_JSON(view::seed_info_param, rwtp);
PREPARE_RESPONSE(view::seed_phrase_info, ar);
ar.error_code = m_backend.get_seed_phrase_info(rwtp.seed_phrase, rwtp.seed_password, ar.response_data).c_str();
LOG_PRINT_CYAN("[get_seed_phrase_info]:" << epee::serialization::store_t_to_json(ar), LOG_LEVEL_0);
return MAKE_RESPONSE(ar);
CATCH_ENTRY_FAIL_API_RESPONCE();
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -16,7 +16,7 @@
</div>
</div>
<div>
<button [routerLink]="['/details']" routerLinkActive="active" tooltip="{{ 'WALLET.TOOLTIPS.SETTINGS' | translate }}" placement="left" tooltipClass="table-tooltip account-tooltip" [delay]="500" [timeDelay]="500" [disabled]="variablesService.daemon_state !== 2">
<button [routerLink]="['/details']" routerLinkActive="active" tooltip="{{ 'WALLET.TOOLTIPS.SETTINGS' | translate }}" placement="left" tooltipClass="table-tooltip account-tooltip" [delay]="500" [timeDelay]="500" [disabled]="variablesService.daemon_state !== 2 || !walletLoaded">
<i class="icon details"></i>
</button>
</div>

View file

@ -27,6 +27,7 @@ export class WalletComponent implements OnInit, OnDestroy {
copyAnimation = false;
copyAnimationTimeout;
balanceTooltip;
walletLoaded;
activeTab = 'history';
public mining = false;
public currentPage = 1;
@ -203,6 +204,7 @@ export class WalletComponent implements OnInit, OnDestroy {
this.variablesService.currentWallet.wakeAlias = false;
}
});
this.updateWalletStatus();
}
resetPaginationValues() {
this.ngZone.run(() => {
@ -369,4 +371,13 @@ export class WalletComponent implements OnInit, OnDestroy {
clearTimeout(this.copyAnimationTimeout);
}
updateWalletStatus() {
this.backend.eventSubscribe('update_wallet_status', (data) => {
const wallet_state = data.wallet_state;
this.walletLoaded = false;
if (wallet_state === 2) {
this.walletLoaded = true;
}
});
}
}