@@ -89,6 +89,11 @@ type RouterClient interface {
89
89
// will not be communicated to the channel peer via any message.
90
90
XDeleteLocalChanAlias (ctx context.Context , alias ,
91
91
baseScid lnwire.ShortChannelID ) error
92
+
93
+ // XFindBaseLocalChanAlias is an experimental API that looks up the base
94
+ // scid for a local chan alias that was registered.
95
+ XFindBaseLocalChanAlias (ctx context.Context ,
96
+ alias lnwire.ShortChannelID ) (lnwire.ShortChannelID , error )
92
97
}
93
98
94
99
// PaymentStatus describe the state of a payment.
@@ -1174,3 +1179,25 @@ func (r *routerClient) XDeleteLocalChanAlias(ctx context.Context, alias,
1174
1179
)
1175
1180
return err
1176
1181
}
1182
+
1183
+ // XFindBaseLocalChanAlias is an experimental API that looks up the base scid
1184
+ // for a local chan alias that was registered.
1185
+ func (r * routerClient ) XFindBaseLocalChanAlias (ctx context.Context ,
1186
+ alias lnwire.ShortChannelID ) (lnwire.ShortChannelID , error ) {
1187
+
1188
+ rpcCtx , cancel := context .WithTimeout (ctx , r .timeout )
1189
+ defer cancel ()
1190
+
1191
+ res , err := r .client .XFindBaseLocalChanAlias (
1192
+ r .routerKitMac .WithMacaroonAuth (rpcCtx ),
1193
+ & routerrpc.FindBaseAliasRequest {
1194
+ Alias : alias .ToUint64 (),
1195
+ },
1196
+ )
1197
+
1198
+ if err != nil {
1199
+ return lnwire.ShortChannelID {}, err
1200
+ }
1201
+
1202
+ return lnwire .NewShortChanIDFromInt (res .Base ), nil
1203
+ }
0 commit comments