CalculateSequenceLocks

Calculates the block height and previous block's median time past at which the transaction will be considered final in the context of BIP 68. For each input that is not sequence locked, the corresponding entries in prevHeights are set to 0 as they do not affect the calculation.

Synopsis

Declared in <consensus/tx_verify.h>

std::pair<int, int64_t>
CalculateSequenceLocks(
    CTransaction const& tx,
    int flags,
    std::vector<int>& prevHeights,
    CBlockIndex const& block);

Return Value

The minimum height and median time past at which tx becomes final.

Parameters

NameDescription
txThe transaction whose sequence locks are computed.
flagsLock-time verification flags controlling BIP 68 enforcement.
prevHeightsConfirmation height of each input, modified in place for non-locked inputs.
blockBlock relative to which the locks are evaluated.