Skip to content

Commit 832109a

Browse files
committed
uint256: 1 is a constant
1 parent 1b313ca commit 832109a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/uint256.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ template std::string base_blob<256>::ToString() const;
8080
template void base_blob<256>::SetHex(const char*);
8181
template void base_blob<256>::SetHex(const std::string&);
8282

83-
uint256& UINT256_ONE() {
84-
static uint256* one = new uint256(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
83+
const uint256& UINT256_ONE() {
84+
static const uint256* one = new uint256(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
8585
return *one;
8686
}

src/uint256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ inline uint256 uint256S(const std::string& str)
147147
return rv;
148148
}
149149

150-
uint256& UINT256_ONE();
150+
const uint256& UINT256_ONE();
151151

152152
#endif // BITCOIN_UINT256_H

0 commit comments

Comments
 (0)