bolt9

Lightning feature flags, per BOLT #9 (docs.ppad.tech/bolt9).
git clone git://git.ppad.tech/bolt9.git
Log | Files | Refs | README | LICENSE

commit 845c02f2fa0a547823c0cb59bd784b28390bb85f
parent b8ce66e205120a75884c8649b924ecc2df05d8b7
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 10 Oct 2026 13:09:23 +0400

lib: check dependencies in validateRemote

BOLT 1 (init) and BOLT 11 (invoice) require the receiver to reject a
feature vector that doesn't set all known transitive dependencies.
validateRemote now includes the dependency check that validateLocal
already performed.

Diffstat:
Mlib/Lightning/Protocol/BOLT9/Validate.hs | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/Lightning/Protocol/BOLT9/Validate.hs b/lib/Lightning/Protocol/BOLT9/Validate.hs @@ -220,6 +220,7 @@ validateNoBothBits !fv = go knownFeatures -- * Unknown even (required) bits are errors -- * If both bits of a pair are set, treat as required (not an error) -- * Context restrictions still apply for known features +-- * All dependencies of set features are also set -- -- >>> import Lightning.Protocol.BOLT9.Codec (setBit) -- >>> validateRemote Init (setBit 999 empty) -- unknown odd bit: ok @@ -230,6 +231,7 @@ validateRemote :: Context -> FeatureVector -> Either [ValidationError] () validateRemote !ctx !fv = let errs = unknownRequiredErrors fv ++ contextErrors ctx fv + ++ dependencyErrors fv ++ parityErrors ctx fv in if null errs then Right ()