rpcserver+invoicesrpc: alias-aware AddInvoice,AddHoldInvoice rpc

AddInvoice,AddHoldInvoice now issue invoices that include our
peer's aliases. Some extra sanity checks are included to ensure we
don't leak our confirmed SCID for a private channel.
This commit is contained in:
eugene committed 2022-07-07 17:10:29 -04:00
1 parent 1aa9626606
commit 0ba67015da
6 files changed
+117 -17

No files matched your search

+7 -2
View File
@@ -274,11 +274,11 @@ func TestSelectHopHints(t *testing.T) {
// hop hint.
h.Mock.On(
"FetchChannelEdgesByID",
private1ShortID,
mock.Anything,
).Return(
nil, nil, nil,
errors.New("no edge"),
)
).Times(4)
},
amount: 100,
channels: []*HopHintInfo{
@@ -536,6 +536,10 @@ func TestSelectHopHints(t *testing.T) {
},
}
getAlias := func(lnwire.ChannelID) (lnwire.ShortChannelID, error) {
return lnwire.ShortChannelID{}, nil
}
for _, test := range tests {
test := test
@@ -548,6 +552,7 @@ func TestSelectHopHints(t *testing.T) {
cfg := &SelectHopHintsCfg{
IsPublicNode: mock.IsPublicNode,
FetchChannelEdgesByID: mock.FetchChannelEdgesByID,
GetAlias: getAlias,
}
hints := SelectHopHints(