Override the current time with a fixed timestamp for testing.
Declared in <kernel/bitcoinkernel.h>
[[nodiscard]]
int
btck_set_mock_time(int64_t timestamp);
Affects all kernel time reads globally. The caller is responsible for gating usage (e.g. restricting to regtest) if desired.
The upper bound (4294967295) matches the maximum value of a block header timestamp.
0 on success, non-zero if timestamp is outside the valid [0, 4294967295]range.
The return value should not be discarded.
| Name | Description |
|---|---|
| timestamp [in] | Unix epoch seconds, or 0 to restore the system clock. |