aboutsummaryrefslogtreecommitdiff
path: root/src/uint256.h
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-07-18 22:24:38 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-07-24 09:15:34 +0200
commitfa103db2bb736bce4440f0bde564e6671e36311d (patch)
tree627a89bedc424b668b97aa1aa90ef30e915de305 /src/uint256.h
parentfafe4b80512a5a82712a3ee81b68cfeb21271dee (diff)
scripted-diff: Rename SetHex to SetHexDeprecated
SetHex is fragile, because it accepts any non-hex input or any length of input, without error feedback. This can lead to issues when the input is truncated or otherwise corrupted. Document the problem by renaming the method. In the future, the fragile method should be removed from the public interface. -BEGIN VERIFY SCRIPT- sed -i 's/SetHex/SetHexDeprecated/g' $( git grep -l SetHex ./src ) -END VERIFY SCRIPT-
Diffstat (limited to 'src/uint256.h')
-rw-r--r--src/uint256.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uint256.h b/src/uint256.h
index 406a9c7203..3f7dce6983 100644
--- a/src/uint256.h
+++ b/src/uint256.h
@@ -59,7 +59,7 @@ public:
// Hex string representations are little-endian.
std::string GetHex() const;
- void SetHex(std::string_view str);
+ void SetHexDeprecated(std::string_view str);
std::string ToString() const;
constexpr const unsigned char* data() const { return m_data.data(); }
@@ -119,7 +119,7 @@ public:
inline uint256 uint256S(std::string_view str)
{
uint256 rv;
- rv.SetHex(str);
+ rv.SetHexDeprecated(str);
return rv;
}