mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 08:13:52 +02:00
Merge #14838: Use const in COutPoint class
cf4b0327edUse std::numeric_limits<UNSIGNED>::max()) instead of (UNSIGNED)-1 (practicalswift)6b82fc59ebUse const in COutPoint class (Hennadii Stepanov) Pull request description: Refactoring: - all cases of using `(uint32_t) -1` in `COutPoint` class are replaced with const; - also all remaining instances of `(UNSIGNED)-1` transformed to `std::numeric_limits<UNSIGNED>::max()` (by @practicalswift). Tree-SHA512: fc7fe9838b6e5136d8b97ea3d6f64c4aaa1215f4369832df432cab017396620bb6e30520a64180ceab6de222562ac11eab243a78dfa5a658ba018835a34caa19
This commit is contained in:
@@ -200,7 +200,7 @@ BOOST_AUTO_TEST_CASE(varints)
|
||||
}
|
||||
|
||||
for (uint64_t i = 0; i < 100000000000ULL; i += 999999937) {
|
||||
uint64_t j = -1;
|
||||
uint64_t j = std::numeric_limits<uint64_t>::max();
|
||||
ss >> VARINT(j);
|
||||
BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void static RandomTransaction(CMutableTransaction &tx, bool fSingle) {
|
||||
txin.prevout.hash = InsecureRand256();
|
||||
txin.prevout.n = InsecureRandBits(2);
|
||||
RandomScript(txin.scriptSig);
|
||||
txin.nSequence = (InsecureRandBool()) ? InsecureRand32() : (unsigned int)-1;
|
||||
txin.nSequence = (InsecureRandBool()) ? InsecureRand32() : std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
for (int out = 0; out < outs; out++) {
|
||||
tx.vout.push_back(CTxOut());
|
||||
|
||||
Reference in New Issue
Block a user