1
0
Fork 0
forked from lthn/blockchain

account_base::get_awo_blob()

This commit is contained in:
sowle 2020-06-01 15:32:00 +03:00
parent d932f1e98d
commit 35370ba485
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 10 additions and 7 deletions

View file

@ -87,6 +87,13 @@ namespace currency
return keys_seed_text + " " + timestamp_word + " " + auditable_flag_and_checksum_word;
}
//-----------------------------------------------------------------
std::string account_base::get_awo_blob() const
{
return get_public_address_str() + ":" +
epee::string_tools::pod_to_hex(m_keys.view_secret_key) +
(m_creation_timestamp ? ":" : "") + (m_creation_timestamp ? epee::string_tools::num_to_string_fast(m_creation_timestamp) : "");
}
//-----------------------------------------------------------------
bool account_base::restore_keys(const std::vector<unsigned char>& keys_seed_binary)
{
CHECK_AND_ASSERT_MES(keys_seed_binary.size() == BRAINWALLET_DEFAULT_SEED_SIZE, false, "wrong restore data size: " << keys_seed_binary.size());

View file

@ -54,6 +54,7 @@ namespace currency
std::string get_public_address_str() const;
std::string get_restore_braindata() const;
std::string get_awo_blob() const;
bool restore_from_braindata(const std::string& seed_phrase);
bool restore_from_awo_blob(const std::string& awo_blob);

View file

@ -1510,13 +1510,8 @@ bool simple_wallet::awo_blob(const std::vector<std::string> &args_)
return true;
}
const account_base& acc = m_wallet->get_account();
success_msg_writer() << "Auditable watch-only blob for this wallet is: ";
std::cout << acc.get_public_address_str() << ":" << epee::string_tools::pod_to_hex(acc.get_keys().view_secret_key);
if (acc.get_createtime())
std::cout << ":" << acc.get_createtime();
std::cout << ENDL;
success_msg_writer() << "Auditable watch-only blob for this wallet is:";
std::cout << m_wallet->get_account().get_awo_blob() << ENDL;
return true;
}
//----------------------------------------------------------------------------------------------------