throw error if account is not provided.
This commit is contained in:
parent
83652317d7
commit
e2425c5b44
@ -2979,6 +2979,10 @@ NAN_METHOD(WalletGetAccountAddress) {
|
|||||||
strAccount = std::string(*account_);
|
strAccount = std::string(*account_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strAccount == EMPTY) {
|
||||||
|
return NanThrowError("No account provided.");
|
||||||
|
}
|
||||||
|
|
||||||
std::string ret = GetAccountAddress(strAccount).ToString();
|
std::string ret = GetAccountAddress(strAccount).ToString();
|
||||||
|
|
||||||
NanReturnValue(NanNew<String>(ret.c_str()));
|
NanReturnValue(NanNew<String>(ret.c_str()));
|
||||||
@ -3189,6 +3193,10 @@ NAN_METHOD(WalletSetRecipient) {
|
|||||||
strAccount = std::string(*account_);
|
strAccount = std::string(*account_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strAccount == EMPTY) {
|
||||||
|
return NanThrowError("No account provided.");
|
||||||
|
}
|
||||||
|
|
||||||
CTxDestination address = CBitcoinAddress(addr).Get();
|
CTxDestination address = CBitcoinAddress(addr).Get();
|
||||||
pwalletMain->SetAddressBook(address, strAccount, "send");
|
pwalletMain->SetAddressBook(address, strAccount, "send");
|
||||||
pwalletMain->SetAddressBook(address, strAccount, "send");
|
pwalletMain->SetAddressBook(address, strAccount, "send");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user