mirror of
https://github.com/monero-project/monero.git
synced 2024-12-26 19:39:24 -05:00
Merge pull request #5673
097cca5
wallet_api: catch getTxKey exception (ph4r05)
This commit is contained in:
commit
6b6593dad9
@ -1742,18 +1742,27 @@ std::string WalletImpl::getTxKey(const std::string &txid_str) const
|
|||||||
|
|
||||||
crypto::secret_key tx_key;
|
crypto::secret_key tx_key;
|
||||||
std::vector<crypto::secret_key> additional_tx_keys;
|
std::vector<crypto::secret_key> additional_tx_keys;
|
||||||
if (m_wallet->get_tx_key(txid, tx_key, additional_tx_keys))
|
try
|
||||||
{
|
{
|
||||||
clearStatus();
|
clearStatus();
|
||||||
std::ostringstream oss;
|
if (m_wallet->get_tx_key(txid, tx_key, additional_tx_keys))
|
||||||
oss << epee::string_tools::pod_to_hex(tx_key);
|
{
|
||||||
for (size_t i = 0; i < additional_tx_keys.size(); ++i)
|
clearStatus();
|
||||||
oss << epee::string_tools::pod_to_hex(additional_tx_keys[i]);
|
std::ostringstream oss;
|
||||||
return oss.str();
|
oss << epee::string_tools::pod_to_hex(tx_key);
|
||||||
|
for (size_t i = 0; i < additional_tx_keys.size(); ++i)
|
||||||
|
oss << epee::string_tools::pod_to_hex(additional_tx_keys[i]);
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setStatusError(tr("no tx keys found for this txid"));
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
setStatusError(tr("no tx keys found for this txid"));
|
setStatusError(e.what());
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user