lnrpc: provide hop hints when adding an invoice with no amount

With this change we allow adding hop hints when adding an invoice, even
if its amount is zero.

A couple of new unit test case have been added, and the
`testInvoiceRoutingHints` itest was expanded to account for this
scenario.
This commit is contained in:
alpeb-btc
2022-10-26 12:57:52 -05:00
parent e68ae33c9a
commit 0cae501009
3 changed files with 106 additions and 4 deletions

View File

@ -1233,6 +1233,15 @@ func testInvoiceRoutingHints(net *lntest.NetworkHarness, t *harnessTest) {
}
checkInvoiceHints(invoice)
// Create another invoice for Alice with no value and ensure it still
// populates routing hints.
invoice = &lnrpc.Invoice{
Memo: "routing hints with no amount",
Value: 0,
Private: true,
}
checkInvoiceHints(invoice)
// Now that we've confirmed the routing hints were added correctly, we
// can close all the channels and shut down all the nodes created.
closeChannelAndAssert(t, net, net.Alice, chanPointBob, false)