1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 01:43:22 +01:00
eclair/contrib/eclair-cli.bash-completion
Bastien Teinturier e09c830f10
Automatically disable from_future_htlc when abused (#2928)
When providing on-the-fly funding with the `from_future_htlc` payment
type, the liquidity provider is paying mining fees for the funding
transaction while trusting that the remote node will accept the HTLCs
afterwards and thus pay a liquidity fees. If the remote node fails the
HTLCs, the liquidity provider doesn't get paid. At that point it can
disable the channel and try to actively double-spend it. When we detect
such behavior, we immediately disable `from_future_htlc` to limit the
exposure to liquidity griefing: it can then be re-enabled by using the
`enableFromFutureHtlc` RPC, or will be automatically re-enabled if the
remote node fulfills the HTLCs after a retry.
2024-10-15 11:18:33 +02:00

40 lines
1.7 KiB
Plaintext

# bash completion for eclair-cli
# copy to /etc/bash_completion.d/
# created by Stadicus
_eclair-cli()
{
local cur prev opts cmds
# eclair-cli might not be in $PATH
local eclaircli
ecli="$1"
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case "$cur" in
-*=*)
return 0
;;
*)
# works fine, but is too slow at the moment.
# allopts=$($eclaircli help 2>&1 | awk '$1 ~ /^"/ { sub(/,/, ""); print $1}' | sed 's/[":]//g')
allopts="allchannels allupdates audit bumpforceclose channel channelbalances channels channelstats close closedchannels connect cpfpbumpfees createinvoice deleteinvoice disconnect enableFromFutureHtlc findroute findroutebetweennodes findroutetonode forceclose getdescriptors getinfo getinvoice getmasterxpub getnewaddress getreceivedinfo getsentinfo globalbalance listinvoices listpendinginvoices listreceivedpayments networkfees node nodes onchainbalance onchaintransactions open parseinvoice payinvoice payoffer peers rbfopen sendonchain sendonionmessage sendtonode sendtoroute signmessage splicein spliceout stop updaterelayfee usablebalances verifymessage"
if ! [[ " $allopts " =~ " $prev " ]]; then # prevent double arguments
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
opts=${allopts}
fi
fi
if [[ -z "$cur" || "$cur" =~ ^- ]]; then
cmds=$($ecli 2>&1 | awk '$1 ~ /^-/ { sub(/,/, ""); print $1}')
fi
COMPREPLY=( $(compgen -W "${cmds} ${opts}" -- ${cur}) )
esac
}
complete -F _eclair-cli eclair-cli