mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
uri remainder
This commit is contained in:
parent
ccc2396d92
commit
1080a90d23
1 changed files with 2 additions and 2 deletions
|
@ -14035,13 +14035,13 @@ std::string wallet2::make_uri(const std::string &address, const std::string &pay
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
bool wallet2::parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error)
|
bool wallet2::parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error)
|
||||||
{
|
{
|
||||||
if (uri.substr(0, 7) != "wownero:")
|
if (uri.substr(0, 8) != "wownero:")
|
||||||
{
|
{
|
||||||
error = std::string("URI has wrong scheme (expected \"wownero:\"): ") + uri;
|
error = std::string("URI has wrong scheme (expected \"wownero:\"): ") + uri;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string remainder = uri.substr(7);
|
std::string remainder = uri.substr(8);
|
||||||
const char *ptr = strchr(remainder.c_str(), '?');
|
const char *ptr = strchr(remainder.c_str(), '?');
|
||||||
address = ptr ? remainder.substr(0, ptr-remainder.c_str()) : remainder;
|
address = ptr ? remainder.substr(0, ptr-remainder.c_str()) : remainder;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue