BIP-113
Median time-past as endpoint for lock-time calculations.
Uses the middle time of the last 11 blocks, not one block's own clock, to decide when time-locked payments can go through.
Block timestamps don't have to be in order, so miners had a reason to fake the time and include time-locked payments early to collect more fees. The middle time of the last 11 blocks only ever moves forward, which removes that reason.
Read BIP-113 in full on GitHubAll BIPs