mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
rpc: reject wrong sized txid
Reporter requested credit to be given to Decred
This commit is contained in:
parent
92e6b7df2c
commit
13eee1d6ab
1 changed files with 4 additions and 6 deletions
|
@ -2453,14 +2453,13 @@ namespace cryptonote
|
||||||
{
|
{
|
||||||
for (const auto &str: req.txids)
|
for (const auto &str: req.txids)
|
||||||
{
|
{
|
||||||
cryptonote::blobdata txid_data;
|
crypto::hash txid;
|
||||||
if(!epee::string_tools::parse_hexstr_to_binbuff(str, txid_data))
|
if(!epee::string_tools::hex_to_pod(str, txid))
|
||||||
{
|
{
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
crypto::hash txid = *reinterpret_cast<const crypto::hash*>(txid_data.data());
|
|
||||||
txids.push_back(txid);
|
txids.push_back(txid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2805,15 +2804,14 @@ namespace cryptonote
|
||||||
res.status = "";
|
res.status = "";
|
||||||
for (const auto &str: req.txids)
|
for (const auto &str: req.txids)
|
||||||
{
|
{
|
||||||
cryptonote::blobdata txid_data;
|
crypto::hash txid;
|
||||||
if(!epee::string_tools::parse_hexstr_to_binbuff(str, txid_data))
|
if(!epee::string_tools::hex_to_pod(str, txid))
|
||||||
{
|
{
|
||||||
if (!res.status.empty()) res.status += ", ";
|
if (!res.status.empty()) res.status += ", ";
|
||||||
res.status += std::string("invalid transaction id: ") + str;
|
res.status += std::string("invalid transaction id: ") + str;
|
||||||
failed = true;
|
failed = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
crypto::hash txid = *reinterpret_cast<const crypto::hash*>(txid_data.data());
|
|
||||||
|
|
||||||
cryptonote::blobdata txblob;
|
cryptonote::blobdata txblob;
|
||||||
if (m_core.get_pool_transaction(txid, txblob, relay_category::legacy))
|
if (m_core.get_pool_transaction(txid, txblob, relay_category::legacy))
|
||||||
|
|
Loading…
Reference in a new issue