lightning-terminal/accounts
Viktor Torstensson ae74392433
accounts: add a configurable maximum account payment size
Add an opt-in cap on the total amount a single account payment may
debit, including routing fees, enforced at the account interceptor for
both SendPaymentV2 and SendToRouteV2. When the new
accounts.max-payment-size-msat config option is set to a non-zero
value, payments whose amount plus fees exceeds it are rejected with
ErrPaymentExceedsMaxSize before the balance check and before any funds
are reserved.

For SendPaymentV2, the configured fee limit is included in the capped
amount. For SendToRouteV2, the route's stated fee is included.

This gives operators a guard rail against a compromised or misbehaving
account macaroon draining its balance in a single large payment. The
cap defaults to 0 (disabled), preserving existing behaviour, and is a
first step towards the finer-grained per-account spending controls
requested in the issue.
2026-08-07 00:04:20 +02:00
..
benchmark_test.go multi: rename MigrationStream names to MigrationSet 2026-05-14 11:39:09 +02:00
checkers.go accounts: add a configurable maximum account payment size 2026-08-07 00:04:20 +02:00
checkers_test.go accounts: add a configurable maximum account payment size 2026-08-07 00:04:20 +02:00
context.go multi: update LND and friends 2025-03-26 09:20:52 -05:00
errors.go accounts: use UpsertAccountPayment in removePayment 2025-01-21 12:20:33 +02:00
interceptor.go accounts: remove accountFromMacaroon helper 2025-05-21 14:14:12 +02:00
interceptor_test.go accounts: add an IDFromCaveates helper 2025-03-04 13:43:13 +02:00
interface.go accounts: add a configurable maximum account payment size 2026-08-07 00:04:20 +02:00
log.go multi: update LND and friends 2025-03-26 09:20:52 -05:00
rpcserver.go accounts: implement AccountPayments RPC handler 2026-07-22 14:06:26 -05:00
service.go accounts: add a configurable maximum account payment size 2026-08-07 00:04:20 +02:00
service_test.go accounts: export kvdb DB 2026-05-14 11:38:32 +02:00
sql_migration.go Merge pull request #1309 from ViktorT-11/2026-05-add-master-additions-to-migration-code 2026-05-19 17:28:45 -07:00
sql_migration_test.go accounts: export kvdb DB 2026-05-14 11:38:32 +02:00
store_kvdb.go accounts: implement ListAccountPayments in BoltStore 2026-07-22 14:06:25 -05:00
store_kvdb_deprecation_test.go multi: deprecate kvdb stores after SQL migration 2026-05-14 11:39:14 +02:00
store_sql.go accounts: implement ListAccountPayments in SQLStore 2026-07-22 14:06:25 -05:00
store_test.go accounts: add payment methods to Store interface 2026-07-22 14:06:25 -05:00
test_kvdb.go accounts: export kvdb DB 2026-05-14 11:38:32 +02:00
test_postgres.go mutli: rename db.NewTestPostgresV2DB function 2026-05-14 11:37:54 +02:00
test_sql.go multi: use sqldb/v2 in accounts package 2026-05-14 11:37:41 +02:00
test_sqlite.go multi: rename MigrationStream names to MigrationSet 2026-05-14 11:39:09 +02:00
tlv.go multi: reformat long lines for readability 2025-12-09 16:12:03 +00:00