lncm / invoicer

Invoice generating service that lives on top of lnd.
https://hub.docker.com/r/lncm/invoicer
MIT License
8 stars 3 forks source link

Add nowallet option - bitcoind using disablewallet=1 config #45

Closed cvasq closed 5 years ago

cvasq commented 5 years ago

Hello, I see a 500 HTTP error and bitcoind error when generating an on-chain payment address.

bitcoind_error

It's caused by the "disablewallet" option enabled on the bitcoind service. Since there is no wallet, the "btcClient.ImportAddress" call to the bitcoind service fails. A simple new configuration option allows the user to disable the bitcoind address import.

meeDamian commented 5 years ago

Thank you.

  1. That's a broken error being returned 😅
  2. Have you tried using off-chain-only=true option? I think it might already be doing what you want.

And if not, please provide a bit more details :)

cvasq commented 5 years ago

Hello @meeDamian, thanks for taking a look. I did try the off-chain-only=true option but it seems that disables on-chain address generation completely. I still want to generate the on-chain address but my instance of bitcoind does not support importing the address generated, as done here: https://github.com/lncm/invoicer/blob/master/main.go#L213-L237

I am using a Raspiblitz node which comes with this disablewallet=1 bitcoind option by default.

meeDamian commented 5 years ago

The reason address is imported into bitcoind is because that's how we track if it received any transactions.

Just disabling it would cause unexpected behaviors, as ex: label field there is used to cross-reference LN invoice with an on-chain address, or checking payment status would either fail, or hang right away :/.

It's probably solvable somehow, it's just not yet written, and I don't really have time to attend to it right now.

cvasq commented 5 years ago

I see, didn't see the payment status being checked against bitcoind. I agree there must be a better solution to this. Going to close this PR and work off my fork for now. Thanks again!