81 constexpr uint256 u256_min{
"0000000000000000000000000000000000000000000000000000000000000000"};
82 constexpr uint256 u256_max{
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"};
111 const unsigned char uch =
static_cast<unsigned char>(
u8);
130 if (
i32 >= 0 &&
i32 <= 16) {
251 }
catch (
const std::ios_base::failure&) {
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
bool MoneyRange(const CAmount &nValue)
bool IsSwitchChar(char c)
arith_uint256 UintToArith256(const uint256 &a)
uint256 ArithToUint256(const arith_uint256 &a)
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
const CChainParams & Params()
Return the currently selected parameters.
const Consensus::Params & GetConsensus() const
A reference to a CKey: the Hash160 of its serialized public key.
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
static opcodetype EncodeOP_N(int n)
A reference to a CScript: the Hash160 of its serialization.
Double ended buffer combining vector and stream-like interfaces.
std::vector< T > ConsumeBytes(size_t num_bytes)
Optimized SipHash-2-4 implementation for uint256.
const std::string & getValStr() const
256-bit unsigned big integer.
static std::optional< uint256 > FromHex(std::string_view str)
uint64_t DecompressAmount(uint64_t x)
uint64_t CompressAmount(uint64_t n)
Compress amount.
unsigned int GetSpecialScriptSize(unsigned int nSize)
uint256 ComputeMerkleRoot(std::vector< uint256 > hashes, bool *mutated)
std::string SighashToStr(unsigned char sighash_type)
UniValue ValueFromAmount(const CAmount amount)
signed char HexDigit(char c)
void initialize_integer()
std::optional< CAmount > ParseMoney(const std::string &money_string)
Parse an amount denoted in full coins.
std::string FormatMoney(const CAmount n)
Money parsing/formatting utilities.
static size_t DynamicUsage(const int8_t &v)
Dynamic memory usage for built-in types is zero.
static size_t IncrementalDynamicUsage(const std::set< X, Y > &s)
std::string ToString(const T &t)
Locale-independent version of std::to_string.
bool AdditionOverflow(const T i, const T j) noexcept
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
bool CheckProofOfWorkImpl(uint256 hash, unsigned int nBits, const Consensus::Params ¶ms)
ServiceFlags
nServices flags
static bool MayHaveUsefulAddressDB(ServiceFlags services)
Checks if a peer with the given service flags may be capable of having a robust address-storage DB.
constexpr unsigned int GetSizeOfCompactSize(uint64_t nSize)
Compact Size size < 253 – 1 byte size <= USHRT_MAX – 3 bytes (253 + 2 bytes) size <= UINT_MAX – 5 byt...
uint8_t ser_readdata8(Stream &s)
void ser_writedata32be(Stream &s, uint32_t obj)
void ser_writedata32(Stream &s, uint32_t obj)
void ser_writedata16(Stream &s, uint16_t obj)
void WriteCompactSize(SizeComputer &os, uint64_t nSize)
uint16_t ser_readdata16(Stream &s)
uint64_t ser_readdata64(Stream &s)
void ser_writedata8(Stream &s, uint8_t obj)
uint64_t ReadCompactSize(Stream &is, bool range_check=true)
Decode a CompactSize-encoded variable-length integer.
uint32_t ser_readdata32(Stream &s)
void ser_writedata64(Stream &s, uint64_t obj)
uint32_t ser_readdata32be(Stream &s)
constexpr bool IsDigit(char c)
Tests if the given character is a decimal digit.
constexpr bool IsSpace(char c) noexcept
Tests if the given character is a whitespace character.
Parameters that influence chain consensus.
bool MultiplicationOverflow(const T i, const T j) noexcept
std::string ToUpper(std::string_view str)
Returns the uppercase equivalent of the given string.
std::string ToLower(std::string_view str)
Returns the lowercase equivalent of the given string.
struct timeval MillisToTimeval(int64_t nTimeout)
Convert milliseconds to a struct timeval for e.g.
constexpr int64_t count_seconds(std::chrono::seconds t)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider