Skip to content

Commit fadc54b

Browse files
author
MarcoFalke
committed
Fix unsigned integer overflow in tapscript validation weight calculation
1 parent 0ff1391 commit fadc54b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/script/script.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ static const uint32_t LOCKTIME_MAX = 0xFFFFFFFFU;
5151
static constexpr unsigned int ANNEX_TAG = 0x50;
5252

5353
// Validation weight per passing signature (Tapscript only, see BIP 342).
54-
static constexpr uint64_t VALIDATION_WEIGHT_PER_SIGOP_PASSED = 50;
54+
static constexpr int64_t VALIDATION_WEIGHT_PER_SIGOP_PASSED{50};
5555

5656
// How much weight budget is added to the witness size (Tapscript only, see BIP 342).
57-
static constexpr uint64_t VALIDATION_WEIGHT_OFFSET = 50;
57+
static constexpr int64_t VALIDATION_WEIGHT_OFFSET{50};
5858

5959
template <typename T>
6060
std::vector<unsigned char> ToByteVector(const T& in)

0 commit comments

Comments
 (0)