chainMedianTime

Default chainTime: the median of the last MTP_BLOCK_SPAN block header times ending at the wallet's synced height, per BIP-113.

Fallbacks, in order:

  • the header store cannot serve the FULL window (near a checkpoint, or pruned): the median is taken over the headers that were collected — the node does the same near genesis, though a checkpoint-truncated window can sit slightly ahead of the node's true median for the first few post-checkpoint blocks;

  • not even the tip header is available (header-less test wallets, no chainstate): the synced block's own header time (Wallet.syncedDate) — the pre-median behaviour, slightly optimistic but the best information available;

  • nothing synced at all: non-positive, which isVaultMature maps to "cannot prove maturity".