Skip to content

Commit 51fa262

Browse files
committed
refactor: Mark some static global vars as const
These were found while looking for static mutable state in the kernel library.
1 parent 39f9b80 commit 51fa262

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core_read.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ bool ParseHashStr(const std::string& strHex, uint256& result)
245245

246246
util::Result<int> SighashFromStr(const std::string& sighash)
247247
{
248-
static std::map<std::string, int> map_sighash_values = {
248+
static const std::map<std::string, int> map_sighash_values = {
249249
{std::string("DEFAULT"), int(SIGHASH_DEFAULT)},
250250
{std::string("ALL"), int(SIGHASH_ALL)},
251251
{std::string("ALL|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY)},

src/script/descriptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ std::string DescriptorChecksum(const Span<const char>& span)
116116
* As a result, within-group-of-32 errors count as 1 symbol, as do cross-group errors that don't affect
117117
* the position within the groups.
118118
*/
119-
static std::string INPUT_CHARSET =
119+
static const std::string INPUT_CHARSET =
120120
"0123456789()[],'/*abcdefgh@:$%{}"
121121
"IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~"
122122
"ijklmnopqrstuvwxyzABCDEFGH`#\"\\ ";
123123

124124
/** The character set for the checksum itself (same as bech32). */
125-
static std::string CHECKSUM_CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
125+
static const std::string CHECKSUM_CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
126126

127127
uint64_t c = 1;
128128
int cls = 0;

0 commit comments

Comments
 (0)