Skip to content

Instantly share code, notes, and snippets.

@jooray
Created February 29, 2024 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jooray/1569aedb80b18af0e44b1b9b753f485e to your computer and use it in GitHub Desktop.
Save jooray/1569aedb80b18af0e44b1b9b753f485e to your computer and use it in GitHub Desktop.
How to settle lnbank balances after lnbank being deprecated

Connect to PSQL:

docker exec -it $(docker ps -a -q -f "name=postgres_1") psql -U postgres -d btcpayservermainnet
set search_path to "BTCPayServer.Plugins.LNbank";

Then you can see wallets:

select * from "Wallets";

Note WalletId. Then for each walletid you want to settle (replace XXXXXXXXXXX with wallet id):

select sum("AmountSettled") from "Transactions" where "WalletId"='XXXXXXXXXXX';

The amount will be in milisatoshis. Divide by 1000 to have it in sats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment