mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 19:24:04 +02:00
routerrpc: allow dest_features graph fallback
This commit is contained in:
@@ -258,7 +258,9 @@ type SendPaymentRequest struct {
|
||||
//*
|
||||
//Features assumed to be supported by the final node. All transitive feature
|
||||
//depdencies must also be set properly. For a given feature bit pair, either
|
||||
//optional or remote may be set, but not both.
|
||||
//optional or remote may be set, but not both. If this field is nil or empty,
|
||||
//the router will try to load destination features from the graph as a
|
||||
//fallback.
|
||||
DestFeatures []lnrpc.FeatureBit `protobuf:"varint,16,rep,packed,name=dest_features,json=destFeatures,proto3,enum=lnrpc.FeatureBit" json:"dest_features,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
|
@@ -109,7 +109,9 @@ message SendPaymentRequest {
|
||||
/**
|
||||
Features assumed to be supported by the final node. All transitive feature
|
||||
depdencies must also be set properly. For a given feature bit pair, either
|
||||
optional or remote may be set, but not both.
|
||||
optional or remote may be set, but not both. If this field is nil or empty,
|
||||
the router will try to load destination features from the graph as a
|
||||
fallback.
|
||||
*/
|
||||
repeated lnrpc.FeatureBit dest_features = 16;
|
||||
}
|
||||
|
@@ -710,7 +710,15 @@ func unmarshallHopHint(rpcHint *lnrpc.HopHint) (zpay32.HopHint, error) {
|
||||
// UnmarshalFeatures converts a list of uint32's into a valid feature vector.
|
||||
// This method checks that feature bit pairs aren't assigned toegether, and
|
||||
// validates transitive depdencies.
|
||||
func UnmarshalFeatures(rpcFeatures []lnrpc.FeatureBit) (*lnwire.FeatureVector, error) {
|
||||
func UnmarshalFeatures(
|
||||
rpcFeatures []lnrpc.FeatureBit) (*lnwire.FeatureVector, error) {
|
||||
|
||||
// If no destination features are specified we'll return nil to signal
|
||||
// that the router should try to use the graph as a fallback.
|
||||
if rpcFeatures == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
raw := lnwire.NewRawFeatureVector()
|
||||
for _, bit := range rpcFeatures {
|
||||
err := raw.SafeSet(lnwire.FeatureBit(bit))
|
||||
|
Reference in New Issue
Block a user