From 0fcd9ce7c8bf1237ff4599aebd0eb78cb454654c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 16 Apr 2018 18:44:25 -0700 Subject: [PATCH] lnwire: add recognition of the data loss proected feature bit In this commit, we add recognition of the data loss protected feature bit. We already implement the full feature set, but then never added the bit to our set of known features. --- lnwire/features.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lnwire/features.go b/lnwire/features.go index 0449bf531..a5968944f 100644 --- a/lnwire/features.go +++ b/lnwire/features.go @@ -16,6 +16,20 @@ import ( type FeatureBit uint16 const ( + // DataLossProtectRequired is a feature bit that indicates that a peer + // *requires* the other party know about the data-loss-protect optional + // feature. If the remote peer does not know of such a feature, then + // the sending peer SHOLUD disconnect them. The data-loss-protect + // feature allows a peer that's lost partial data to recover their + // settled funds of the latest commitment state. + DataLossProtectRequired FeatureBit = 0 + + // DataLossProtectOptional is an optional feature bit that indicates + // that the sending peer knows of this new feature and can activate it + // it. The data-loss-protect feature allows a peer that's lost partial + // data to recover their settled funds of the latest commitment state. + DataLossProtectOptional FeatureBit = 1 + // InitialRoutingSync is a local feature bit meaning that the receiving // node should send a complete dump of routing information when a new // connection is established. @@ -42,7 +56,7 @@ const ( // not advertised to the entire network. A full description of these feature // bits is provided in the BOLT-09 specification. var LocalFeatures = map[FeatureBit]string{ - InitialRoutingSync: "initial-routing-sync", + DataLossProtectOptional: "data-loss-protect-optional", } // GlobalFeatures is a mapping of known global feature bits to a descriptive