mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Avoid using numeric_limits for sequence numbers and lock times
Switches to named constants, because numeric_limits calls can be harder to read and less portable. Change was suggested by James O'Beirne <james.obeirne@gmail.com> in https://github.com/bitcoin/bitcoin/pull/10973#discussion_r213473620 There are no changes in behavior except on some platforms we don't support (ILP64, IP16L32, I16LP32), where SignalsOptInRBF() and MutateTxAddInput() functions would now work correctly.
This commit is contained in:
@@ -255,7 +255,7 @@ static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInpu
|
||||
throw std::runtime_error("invalid TX input vout '" + strVout + "'");
|
||||
|
||||
// extract the optional sequence number
|
||||
uint32_t nSequenceIn=std::numeric_limits<unsigned int>::max();
|
||||
uint32_t nSequenceIn = CTxIn::SEQUENCE_FINAL;
|
||||
if (vStrInputParts.size() > 2)
|
||||
nSequenceIn = std::stoul(vStrInputParts[2]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user