addinvoice --private doesn't add hop hints if no amount is provided
Background
lncli addinvoice --private returns an invoice without hop hints; if an amount is provided the --private option works as expected.
Your environment
- lnd version 0.15.0-beta commit=v0.15.0-beta
Expected behaviour
Either provide hop hints. Or if that's not technologically possible, return an error.
Capturing root-cause analysis comments
https://github.com/lightningnetwork/lnd/blob/f7b74426808c0305eb594bb0addbf4c1c035d9cd/lnrpc/invoicesrpc/addinvoice.go#L695
Initial assessment:
lnd would use the amt to decide what to place in the hop hint (most MPP), but maybe we had a regression there [...] prob a 0 >= 0 case, which causes things to break early [...] we check to see if we have enough: the amount is zero and we have zero added in hop hints so it's like ok
e.g.
Due to the amount being 0 sufficientHints prematurely returns true before lnd has assembled enough routing hints