fusion44 / blitz_api

A management backend for the RaspiBlitz project written in Python / FastAPI
MIT License
19 stars 18 forks source link

can't send all funds out on-chain #139

Closed cstenglein closed 1 year ago

cstenglein commented 2 years ago

If I have 210k sats & want to send 210k sats (i.e. all funds) to another on-chain address, this doesn't work

I get a 500 response from lightning/send-coins

fusion44 commented 2 years ago

Please ssh into the Blitz and observe the logs: sudo journalctl -fu blitzapi What is the error?

fusion44 commented 2 years ago

I was just thinking about this. What is probably happening here is that if you try to send out all funds, nothing is left to cover the network fees. Not sure how to handle actually this server side. Maybe its best to add an extra endpoint sweep-funds for this and let the node implementation handle the details. Nonetheless this shouldn't return a 500.

cstenglein commented 2 years ago

https://api.lightning.community/#sendcoins use send_all

fusion44 commented 1 year ago

@cstenglein Please test this. Seems to work for me. Especially, try to break the API :crossed_swords:

From the docs: image

cstenglein commented 1 year ago

Your commit is in the refactor_system branch which Is blocked by https://github.com/fusion44/blitz_api/pull/149#issuecomment-1328610770 so I can't test it.

fusion44 commented 1 year ago

This should work now.