You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #380: Use != 0 instead of == 1 for check of masked value
b747e51 Use != 0 instead of == 1 for check of masked value (Tobin C. Harding)
Pull request description:
Recently [0] we added a check on a value masked against `SEQUENCE_LOCKTIME_DISABLE_FLAG`, this check uses `x == 1` but x can never be zero since `SEQUENCE_LOCKTIME_DISABLE_FLAG` is equal to `0x80000000`.
Looking at the original commit it looks like we are trying to check for a value _higher_ than the flag value, so we can mask then use `x != 0` to see if the flag bit is enabled.
Found by clippy:
error: incompatible bit mask: `_ & 2147483648` can never be equal to `1`
CC: @darosior, have I understood this correctly man?
[0] commit: `commit a3dd9fe`
ACKs for top commit:
darosior:
Oh, right 🤦. Good catch. ACK b747e51.
sanket1729:
Wow. Thanks for catching this bug! ACK b747e51
Tree-SHA512: ee609ee39eaf23960e205ab7b4b44b04dc59f4bb175cd532af64eb3ffd5e3325e910efa327d30334c7947f607d93c4b4362d6a89706a3013aa11a912e6b27528
0 commit comments