Skip to content

Commit 7d9589e

Browse files
committed
routerrpc+zpay32: EstimateRouteFee overhaul
In this commit the mission control based fee estimation is supplemented with a payment probe estimation which can lead to more accurate estimation results. The probing utilizes a hop-hint heurisic to detect routes through LSPs in order to manually estimate fees to destinations behind an LSP that would otherwise block the payment probe.
1 parent 24080c5 commit 7d9589e

File tree

4 files changed

+645
-22
lines changed

4 files changed

+645
-22
lines changed

lnrpc/routerrpc/router_backend.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,8 +1175,18 @@ func unmarshallHopHint(rpcHint *lnrpc.HopHint) (zpay32.HopHint, error) {
11751175
}, nil
11761176
}
11771177

1178+
// MarshalFeatures converts a feature vector into a list of uint32's.
1179+
func MarshalFeatures(feats *lnwire.FeatureVector) []lnrpc.FeatureBit {
1180+
var featureBits []lnrpc.FeatureBit
1181+
for feature := range feats.Features() {
1182+
featureBits = append(featureBits, lnrpc.FeatureBit(feature))
1183+
}
1184+
1185+
return featureBits
1186+
}
1187+
11781188
// UnmarshalFeatures converts a list of uint32's into a valid feature vector.
1179-
// This method checks that feature bit pairs aren't assigned toegether, and
1189+
// This method checks that feature bit pairs aren't assigned together, and
11801190
// validates transitive dependencies.
11811191
func UnmarshalFeatures(
11821192
rpcFeatures []lnrpc.FeatureBit) (*lnwire.FeatureVector, error) {

0 commit comments

Comments
 (0)