Источник / закреплённая редакция
Median time-past as endpoint for lock-time calculations
Источник пакета btc.consensus · BIP 113
- work
- urn:btc:clir:consensus#BIP113
- номер
- BIP 113
- вид
- urn:btc:clir:consensus#other
BIP 113 raw MediaWiki at 7fe0b034ec967b52a5a28276419117326df93263
- edition
- urn:btc:clir:consensus#BIP113_RAW
- язык
- en
- официальность
- official
- материализация
- PINNED_OFFICIAL_BYTES
- жизненный цикл
- —
Публикации
| URI | Тип | documentHash | Получено |
|---|---|---|---|
| https://raw.githubusercontent.com/bitcoin/bips/7fe0b034ec967b52a5a28276419117326df93263/bip-0113.mediawiki | text/plain; charset=utf-8 | sha256:f0643ba529837a673015a37287c21972bfa24cebfdc67e2844c6ad8d51d1ea69 | 2026-08-31T00:00:00Z |
Фрагменты — 1
Specification · section · на него ссылаются: 4
en · official · sha256:d1ca9987b1c7d12b2e6778a8d1d424892071264daa441f715cd87c62bffc3fa3EN
The values for transaction locktime remain unchanged. The difference is only in
the calculation determining whether a transaction can be included. Instead of
an unreliable timestamp, the following function is used to determine the current
block time for the purpose of checking lock-time constraints:
enum { nMedianTimeSpan=11 };
int64_t GetMedianTimePast(const CBlockIndex* pindex)
{
int64_t pmedian[nMedianTimeSpan];
int64_t* pbegin = &pmedian[nMedianTimeSpan];
int64_t* pend = &pmedian[nMedianTimeSpan];
for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
*(--pbegin) = pindex->GetBlockTime();
std::sort(pbegin, pend);
return pbegin[(pend - pbegin)/2];
}
Lock-time constraints are checked by the consensus method IsFinalTx().
This method takes the block time as one parameter. This BIP proposes
that after activation calls to IsFinalTx() within consensus code use
the return value of `GetMedianTimePast(pindexPrev)` instead.
The new rule applies to all transactions, including the coinbase transaction.Ссылаются нормы: TimeLocktimeUsesPreviousMtp, nlocktime_median_time, previous_block_median_time_for_tx, timestamp_strictly_after_median_of_11_predecessors
Хэш рядом с текстом — sha256 его точных байтов. Он и есть проверка того, что показанный текст совпадает с закреплённым в пакете: расхождение роняет статику оракула.