diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-01-31 16:54:51 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-01-31 16:39:40 +0100 |
commit | fadc54b79b14ba0bbdcf5eff1277295851fe7a9e (patch) | |
tree | b930d4cc7fe715f061185d6a79715455d36993ce /src/script | |
parent | 0ff13913287b3874e305535c78bc43b190217168 (diff) | |
download | bitcoin-fadc54b79b14ba0bbdcf5eff1277295851fe7a9e.tar.xz |
Fix unsigned integer overflow in tapscript validation weight calculation
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/script.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/script.h b/src/script/script.h index 3425bf8102..8b7a7bb7b3 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -51,10 +51,10 @@ static const uint32_t LOCKTIME_MAX = 0xFFFFFFFFU; static constexpr unsigned int ANNEX_TAG = 0x50; // Validation weight per passing signature (Tapscript only, see BIP 342). -static constexpr uint64_t VALIDATION_WEIGHT_PER_SIGOP_PASSED = 50; +static constexpr int64_t VALIDATION_WEIGHT_PER_SIGOP_PASSED{50}; // How much weight budget is added to the witness size (Tapscript only, see BIP 342). -static constexpr uint64_t VALIDATION_WEIGHT_OFFSET = 50; +static constexpr int64_t VALIDATION_WEIGHT_OFFSET{50}; template <typename T> std::vector<unsigned char> ToByteVector(const T& in) |