1
0
Fork 0
forked from lthn/blockchain

Merge branch 'master' into develop

This commit is contained in:
sowle 2019-12-28 03:14:52 +03:00
commit cc099507fa
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
10 changed files with 64 additions and 16 deletions

View file

@ -30,7 +30,21 @@ Recommended OS version: Ubuntu 17.04 LTS.
For GUI version:\
`$ sudo apt-get install -y build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev cmake git libboost-all-dev screen mesa-common-dev libglu1-mesa-dev qt5-default qtwebengine5-dev`
2. `$ cd zano/ && make -j$(nproc) gui`
2. Building binaries \
2.1. Building daemon and simplewallet: \
  `$ cd zano/ && make -j` \
  or \
  `$ cd zano && mkdir build && cd build `\
  `$ cmake .. `\
  `$ make -j daemon simplewallet` \
2.2. Building GUI: \
  `$ cd zano/ && make -j gui ` \
  or \
  `$ cd zano && mkdir build && cd build `\
  `$ cmake -D BUILD_GUI=ON .. `\
  `$ make -j Zano` \
  `$ rsync -haP ~/zano/src/gui/qt-daemon/html ~/zano/build/src` \
NOTICE: If you are building on machine with relatively small anount of RAM(small VPS for example, less then 16GB) and without proper setting of virtual memory, then be careful with setting `-j` option, this may cause compiller crashes.
3. Look for the binaries, including the `Zano` GUI, in the build directory
### Windows
@ -54,14 +68,14 @@ Recommended OS version: macOS Sierra 10.12.6 x64.
To build GUI application:
1. Create self-signing certificate via Keychain Access:
a. Run Keychain Access.
b. Choose Keychain Access > Certificate Assistant > Create a Certificate.
c. Use “Zano” (without quotes) as certificate name.
d. Choose “Code Signing” in “Certificate Type” field.
e. Press “Create”, then “Done”.
f. Make sure the certificate was added to keychain "System". If not—move it to "System".
g. Double click the certificate you've just added, enter the trust section and under "When using this certificate" select "Always trust".
1. Create self-signing certificate via Keychain Access:\
a. Run Keychain Access.\
b. Choose Keychain Access > Certificate Assistant > Create a Certificate.\
c. Use “Zano” (without quotes) as certificate name.\
d. Choose “Code Signing” in “Certificate Type” field.\
e. Press “Create”, then “Done”.\
f. Make sure the certificate was added to keychain "System". If not—move it to "System".\
g. Double click the certificate you've just added, enter the trust section and under "When using this certificate" select "Always trust".\
h. Unfold the certificate in Keychain Access window and double click underlying private key "Zano". Select "Access Control" tab, then select "Allow all applications to access this item". Click "Save Changes".
2. Revise building script, comment out unwanted steps and run it: `utils/build_script_mac_osx.sh`
3. The application should be here: `/buid_mac_osx_64/release/src`

View file

@ -28,16 +28,21 @@ namespace currency
//-----------------------------------------------------------------
account_base::account_base()
:m_keys{}
,m_creation_timestamp{}
,m_seed{}
{
set_null();
}
//-----------------------------------------------------------------
void account_base::set_null()
{
// fill sensitive data with random bytes
crypto::generate_random_bytes(sizeof m_keys.m_spend_secret_key, &m_keys.m_spend_secret_key);
crypto::generate_random_bytes(sizeof m_keys.m_view_secret_key, &m_keys.m_view_secret_key);
crypto::generate_random_bytes(m_seed.size(), &m_seed[0]);
// clear
m_keys = account_keys();
m_creation_timestamp = 0;
m_seed.clear();
}
//-----------------------------------------------------------------
void account_base::generate()
@ -65,6 +70,8 @@ namespace currency
std::string account_base::get_restore_braindata() const
{
std::string restore_buff = get_restore_data();
if (restore_buff.empty())
return "";
std::vector<unsigned char> v;
v.assign((unsigned char*)restore_buff.data(), (unsigned char*)restore_buff.data() + restore_buff.size());
std::string seed_brain_data = tools::mnemonic_encoding::binary2text(v);
@ -124,7 +131,23 @@ namespace currency
//-----------------------------------------------------------------
void account_base::make_account_watch_only()
{
m_keys.m_spend_secret_key = currency::null_skey;
// keep only:
// timestamp
// view pub & spend pub (public address)
// view sec
// store to local tmp
uint64_t local_ts = m_creation_timestamp;
account_public_address local_addr = m_keys.m_account_address;
crypto::secret_key local_view_sec = m_keys.m_view_secret_key;
// clear
set_null();
// restore
m_creation_timestamp = local_ts;
m_keys.m_account_address = local_addr;
m_keys.m_view_secret_key = local_view_sec;
}
//-----------------------------------------------------------------
std::string transform_addr_to_str(const account_public_address& addr)

View file

@ -676,7 +676,9 @@ std::string daemon_backend::open_wallet(const std::wstring& path, const std::str
{
try
{
w->load(path, password);
w->load(path, password);
if (w->is_watch_only())
return API_RETURN_CODE_WALLET_WATCH_ONLY_NOT_SUPPORTED;
w->get_recent_transfers_history(owr.recent_history.history, 0, txs_to_return, owr.recent_history.total_history_items);
//w->get_unconfirmed_transfers(owr.recent_history.unconfirmed);
w->get_unconfirmed_transfers(owr.recent_history.history);

View file

@ -736,6 +736,7 @@ public:
#define API_RETURN_CODE_BAD_ARG_WRONG_PAYMENT_ID "BAD_ARG_WRONG_PAYMENT_ID"
#define API_RETURN_CODE_WRONG_PASSWORD "WRONG_PASSWORD"
#define API_RETURN_CODE_WALLET_WRONG_ID "WALLET_WRONG_ID"
#define API_RETURN_CODE_WALLET_WATCH_ONLY_NOT_SUPPORTED "WALLET_WATCH_ONLY_NOT_SUPPORTED"
#define API_RETURN_CODE_FILE_NOT_FOUND "FILE_NOT_FOUND"
#define API_RETURN_CODE_ALREADY_EXISTS "ALREADY_EXISTS"
#define API_RETURN_CODE_CANCELED "CANCELED"

View file

@ -581,6 +581,7 @@
"TRANSACTION_ERROR": "Error. Transaction not completed.",
"BAD_ARG": "Invalid argument",
"WALLET_WRONG_ID": "Invalid wallet ID",
"WALLET_WATCH_ONLY_NOT_SUPPORTED": "Watch-only wallets can only be opened by simplewallet",
"WRONG_PASSWORD": "Invalid password",
"FILE_RESTORED": "The wallet file was corrupted. We have recovered the keys and the wallet from the blockchain",
"FILE_NOT_FOUND": "File not found",

View file

@ -1843,6 +1843,9 @@ var BackendService = /** @class */ (function () {
case 'WALLET_WRONG_ID':
error_translate = 'ERRORS.WALLET_WRONG_ID';
break;
case 'WALLET_WATCH_ONLY_NOT_SUPPORTED':
error_translate = 'ERRORS.WALLET_WATCH_ONLY_NOT_SUPPORTED';
break;
case 'WRONG_PASSWORD':
case 'WRONG_PASSWORD:invalid password':
params = JSON.parse(params);

View file

@ -109,6 +109,9 @@ export class BackendService {
case 'WALLET_WRONG_ID':
error_translate = 'ERRORS.WALLET_WRONG_ID';
break;
case 'WALLET_WATCH_ONLY_NOT_SUPPORTED':
error_translate = 'ERRORS.WALLET_WATCH_ONLY_NOT_SUPPORTED';
break;
case 'WRONG_PASSWORD':
case 'WRONG_PASSWORD:invalid password':
params = JSON.parse(params);

View file

@ -581,6 +581,7 @@
"TRANSACTION_ERROR": "Error. Transaction not completed.",
"BAD_ARG": "Invalid argument",
"WALLET_WRONG_ID": "Invalid wallet ID",
"WALLET_WATCH_ONLY_NOT_SUPPORTED": "Watch-only wallets can only be opened by simplewallet",
"WRONG_PASSWORD": "Invalid password",
"FILE_RESTORED": "The wallet file was corrupted. We have recovered the keys and the wallet from the blockchain",
"FILE_NOT_FOUND": "File not found",

View file

@ -8,6 +8,6 @@
#define PROJECT_REVISION "4"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
#define PROJECT_VERSION_BUILD_NO 76
#define PROJECT_VERSION_BUILD_NO 77
#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

@ -2097,7 +2097,7 @@ void wallet2::store(const std::wstring& path_to_save, const std::string& passwor
//prepare data
std::string keys_buff;
bool r = store_keys(keys_buff, password);
bool r = store_keys(keys_buff, password, m_watch_only);
WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(r, "failed to store_keys for wallet " << ascii_path_to_save);
//store data