aboutsummaryrefslogtreecommitdiff
path: root/src/checkpoints
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-26 00:19:10 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-12-08 02:00:34 +0000
commit3a3858dc908934be82ffe4f0d693ebb518397a28 (patch)
treea3823e49cc8f2e4be50c192d398969f76d6df766 /src/checkpoints
parentMerge pull request #4878 (diff)
downloadmonero-3a3858dc908934be82ffe4f0d693ebb518397a28.tar.xz
epee: avoid string allocation when parsing a pod from string
Diffstat (limited to 'src/checkpoints')
-rw-r--r--src/checkpoints/checkpoints.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp
index 1807d44d9..96f575b2d 100644
--- a/src/checkpoints/checkpoints.cpp
+++ b/src/checkpoints/checkpoints.cpp
@@ -74,7 +74,7 @@ namespace cryptonote
bool checkpoints::add_checkpoint(uint64_t height, const std::string& hash_str)
{
crypto::hash h = crypto::null_hash;
- bool r = epee::string_tools::parse_tpod_from_hex_string(hash_str, h);
+ bool r = epee::string_tools::hex_to_pod(hash_str, h);
CHECK_AND_ASSERT_MES(r, false, "Failed to parse checkpoint hash string into binary representation!");
// return false if adding at a height we already have AND the hash is different
@@ -292,7 +292,7 @@ namespace cryptonote
// parse the second part as crypto::hash,
// if this fails move on to the next record
std::string hashStr = record.substr(pos + 1);
- if (!epee::string_tools::parse_tpod_from_hex_string(hashStr, hash))
+ if (!epee::string_tools::hex_to_pod(hashStr, hash))
{
continue;
}