LIGHTNING-AUTOCLEAN-ONCE(7)
π
LIGHTNING-AUTOCLEAN-ONCE(7) β the autoclean-once page, bestie edition
okay so this is the manual page for autoclean-once, from LIGHTNING-AUTOCLEAN-ONCE(7). yes that's the whole title, she's long, she's iconic, we move π
β¨ NAME β¨
autoclean-once β a single deletion of old invoices/payments/forwards. one sweep. that's it. that's the vibe π§Ή
πΈ SYNOPSIS πΈ
autoclean-once subsystem age
π¦ DESCRIPTION π¦
The autoclean-once RPC command tells the autoclean plugin to do a single sweep to delete old entries. It's basically the manual version (or the bonus round, your call) of all those autoclean-...-age parameters that make autoclean run once per hour β go peek at lightningd-config(5) for those, iykyk.
subsystem(string) (one of"succeededforwards","failedforwards","succeededpays","failedpays","paidinvoices","expiredinvoices","networkevents") β which subsystem to clean, bestie. currently supported subsystems are:failedforwardsβ routed payments which did not succeed (failedorlocal_failedinlistforwardsstatus).succeededforwardsβ routed payments which succeeded (settledinlistforwardsstatus).failedpaysβ payment attempts which did not succeed (failedinlistpaysstatus).succeededpaysβ payment attempts which succeeded (completeinlistpaysstatus).expiredinvoicesβ invoices which were not paid (and cannot be) (expiredinlistinvoicesstatus).paidinvoicesβ invoices which were paid (paidinlistinvoices`status).networkeventsβ all events inlistnetworkevents(added v25.12)
NOTE: until v25.12, theuncleanedfield contained all entries not removed (e.g. infailedforwardsit counted all forwards, not just failed ones). This was an interface only an engineer could love, so it was fixed. π οΈ
age(u64) β non-zero number in seconds. how many seconds old an entry must be to get deleted. literally the "you must be this old to ride" sign π’
π RETURN VALUE π
On success, an object containing autoclean is returned. It's an object containing:
succeededforwards(object, optional):cleaned(u64) β the number of successful forwards deleted.uncleaned(u64) β the number of successful forwards not deleted (too new).
failedforwards(object, optional):cleaned(u64) β the number of failed forwards deleted.uncleaned(u64) β the number of failed forwards not deleted (too new).
succeededpays(object, optional):cleaned(u64) β the number of successful payments deleted.uncleaned(u64) β the number of successful forwards not deleted (too new).
failedpays(object, optional):cleaned(u64) β the number of unsuccessful payments deleted.uncleaned(u64) β the number of unsuccessful payments not deleted (too new).
paidinvoices(object, optional):cleaned(u64) β the number of paid invoices deleted.uncleaned(u64) β the number of paid invoices not deleted (too new).
expiredinvoices(object, optional):cleaned(u64) β the number of expired invoices deleted.uncleaned(u64) β the number of expired invoices not deleted (too new).
networkevents(object, optional) (added v25.12):cleaned(u64) β total number of deletions done this run. (added v25.12)uncleaned(u64) β the total number of entries not deleted this run. (added v25.12)
π AUTHOR π
Rusty Russell rusty@rustcorp.com.au is mainly responsible. yes, the Rusty. we stan π«Ά
π SEE ALSO π
lightningd-config(5), lightning-autoclean-status(7)
β RESOURCES β
Main web site: https://github.com/ElementsProject/lightning
π₯ EXAMPLES π₯
Example 1:
Request:
$ lightning-cli autoclean-once "failedpays" "1"
{
"id": "example:autoclean-once#1",
"method": "autoclean-once",
"params": [
"failedpays",
1
]
}
Response:
{
"autoclean": {
"failedpays": {
"cleaned": 0,
"uncleaned": 7
}
}
}
Example 2:
Request:
$ lightning-cli autoclean-once "succeededpays" "1"
{
"id": "example:autoclean-once#2",
"method": "autoclean-once",
"params": [
"succeededpays",
1
]
}
Response:
{
"autoclean": {
"succeededpays": {
"cleaned": 7,
"uncleaned": 0
}
}
}
and that's the whole page, bestie π this iconic little number ships with Core Lightning v26.06.9 β go forth and clean, mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms