refundlock

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package refundlock holds the pure nLockTime comparison rules for MultisigPool refund templates. It lives under internal so it can never become part of the public SDK surface: callers pass explicit time/height facts into the SDK and the SDK never reads wall-clock or node state here.

Index

Constants

View Source
const TimestampThreshold = 500000000

TimestampThreshold 是 nLockTime 的解释分界:低于它为区块高,否则为 UTC Unix 时间戳。它是仓库唯一的阈值真值。

Variables

View Source
var (
	// ErrNotMatured reports that the refund lock has not matured yet.
	ErrNotMatured = errors.New("refund locktime not reached")
	// ErrMatured reports that the refund lock has already matured.
	ErrMatured = errors.New("pool refund has expired")
)

Functions

func CheckExpired

func CheckExpired(lockTime uint32, at time.Time, blockHeight uint32) error

CheckExpired reports whether the refund is executable at "at" (timestamp locks) or at blockHeight (height locks). It returns nil when matured and ErrNotMatured otherwise. It is pure: no clock read, no node query.

func CheckNotExpired

func CheckNotExpired(lockTime uint32, at time.Time, blockHeight uint32) error

CheckNotExpired is the forward-operation gate: refund 仍被锁定时返回 nil; 已经到期时返回 ErrMatured。

func UsesBlockHeight

func UsesBlockHeight(lockTime uint32) bool

UsesBlockHeight classifies the raw nLockTime value: values below the timestamp threshold are block heights, everything else is a Unix timestamp.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL