mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 22:24:05 +01:00
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:
@@ -18,7 +18,7 @@ std::string base_blob<BITS>::GetHex() const
|
||||
}
|
||||
|
||||
template <unsigned int BITS>
|
||||
void base_blob<BITS>::SetHex(const std::string_view str)
|
||||
void base_blob<BITS>::SetHexDeprecated(const std::string_view str)
|
||||
{
|
||||
std::fill(m_data.begin(), m_data.end(), 0);
|
||||
|
||||
@@ -52,12 +52,12 @@ std::string base_blob<BITS>::ToString() const
|
||||
// Explicit instantiations for base_blob<160>
|
||||
template std::string base_blob<160>::GetHex() const;
|
||||
template std::string base_blob<160>::ToString() const;
|
||||
template void base_blob<160>::SetHex(std::string_view);
|
||||
template void base_blob<160>::SetHexDeprecated(std::string_view);
|
||||
|
||||
// Explicit instantiations for base_blob<256>
|
||||
template std::string base_blob<256>::GetHex() const;
|
||||
template std::string base_blob<256>::ToString() const;
|
||||
template void base_blob<256>::SetHex(std::string_view);
|
||||
template void base_blob<256>::SetHexDeprecated(std::string_view);
|
||||
|
||||
const uint256 uint256::ZERO(0);
|
||||
const uint256 uint256::ONE(1);
|
||||
|
||||
Reference in New Issue
Block a user