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-
This commit is contained in:
MarcoFalke
2024-07-18 22:24:38 +02:00
parent fafe4b8051
commit fa103db2bb
6 changed files with 19 additions and 19 deletions

View File

@@ -239,7 +239,7 @@ bool ParseHashStr(const std::string& strHex, uint256& result)
if ((strHex.size() != 64) || !IsHex(strHex))
return false;
result.SetHex(strHex);
result.SetHexDeprecated(strHex);
return true;
}