Post
Topic
Board Development & Technical Discussion
Merits 6 from 2 users
Re: Going backward in time
by
pooya87
on 13/10/2021, 03:49:40 UTC
⭐ Merited by vjudeu (5) ,JayJuanGee (1)
Standard unix time uses a signed 4-byte integer. If I remember correctly, Bitcoin blocks use an unsigned 4-byte integer. This allows an additional 68 years before it becomes a problem.

I'm not sure if the overflow has been addressed in code yet, but if it hasn't, then we've got about 85 more years to take care of it.
In block header the value can be either signed or unsigned (it is just a byte stream) but when it comes to comparison it will be cast to (signed) Int64 then compared to address the overflows.