From 4977c30d59e88a3e5ee248144bcc023debcd895b Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 30 Dec 2019 14:05:27 -0500 Subject: refactor: define a UINT256_ONE global constant Instead of having a uint256 representations of one scattered throughout where it is used, define it globally in uint256.h --- src/uint256.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/uint256.cpp') diff --git a/src/uint256.cpp b/src/uint256.cpp index 6398d6326f..a943e71062 100644 --- a/src/uint256.cpp +++ b/src/uint256.cpp @@ -75,3 +75,8 @@ template std::string base_blob<256>::GetHex() const; template std::string base_blob<256>::ToString() const; template void base_blob<256>::SetHex(const char*); template void base_blob<256>::SetHex(const std::string&); + +uint256& UINT256_ONE() { + static uint256* one = new uint256(uint256S("0000000000000000000000000000000000000000000000000000000000000001")); + return *one; +} -- cgit v1.2.3