Commit graph

752 commits

Author SHA1 Message Date
Elle Mouton
ea88a26870
lncli: add wallet submitpackage command
Add a `wallet submitpackage` command that takes one or more hex-encoded
raw transactions (topologically sorted, parents first and the child
last) and an optional --max_fee_rate, and submits them as a package via
the WalletKit.SubmitPackage RPC.
2026-06-30 11:07:52 -07:00
Oli
8047149c6a
multi: upgrade to btcd v2 modules
Migrate all btcd dependencies to the new per-package v2 modules (wire/v2,
txscript/v2, chaincfg/v2, chainhash/v2, btcutil/v2, psbt/v2, btcec/v2)
introduced by btcd v0.26.0, and pin the tagged ecosystem versions:
btcwallet v0.17.0, neutrino v0.18.0 and lightning-onion v1.4.0.

The bulk of the import rewrite was produced by the scripted diff from
https://github.com/btcsuite/btcd/pull/2547 (followed by 'make rpc'). The
address symbols that moved out of btcutil into the new address package
are imported as btcaddr where a local "address" variable would otherwise
shadow them. The go.mod/go.sum updates and the remaining manual
compilation fixes are folded into this single commit so it builds on its
own (the migration was previously split into a reproducible scripted-diff
plus follow-ups, intended to be squashed on merge).
2026-06-24 10:58:36 -07:00
Erick Cestari
d9355bbe0f
lint: fix wastedassign issues in non-test files 2026-06-03 15:32:46 -03:00
Olaoluwa Osuntokun
0aa1d8bdd6 multi: rename "taproot" channel type to mean production variant
In this commit, we shuffle the CLI and RPC names so the bare "taproot"
identifier refers to the production taproot channel type (final
scripts, feature bits 80/81), i.e. the variant new integrations should
actually be using. Before this commit, "taproot" on the CLI mapped to
the staging bits, and anyone who wanted a real production taproot
channel had to spell out "taproot-final" on `lncli openchannel` or
`SIMPLE_TAPROOT_FINAL` over RPC. The recommended choice was hidden
behind the longer name.

On the CLI (`lncli openchannel --channel_type=...`):

  - "taproot" now selects the production variant (it used to mean
    staging).
  - "taproot-staging" is added for the legacy development bits, for
    peers that haven't moved over yet.
  - "taproot-final" stays as a deprecated alias for "taproot" so
    existing scripts don't break.

On the RPC (`CommitmentType`):

  - `TAPROOT = 7` is added as the canonical name for the production
    type. `SIMPLE_TAPROOT_FINAL = 7` is kept as a deprecated alias via
    `option allow_alias = true`, so existing clients keep compiling
    against the same Go constant and the wire value doesn't change.
  - `SIMPLE_TAPROOT = 5` (staging) is unchanged.
  - `SIMPLE_TAPROOT_OVERLAY = 6` is unchanged. The taproot-assets
    daemon hard-codes this distinct enum value, so it's unaffected.

Wire compat is preserved end-to-end: only the comments, enum entry
order, and the CLI string-to-enum mapping change. The numeric values
and the existing generated Go identifiers stay stable.
2026-05-20 22:22:38 -07:00
Jaewook Lee
ea79df7a74
cmd: add outgoing_chan_id flag to estimatefee 2026-05-15 17:04:39 +09:00
Olaoluwa Osuntokun
65d04f3461 multi: fix linter issues 2026-04-13 12:21:42 -07:00
Olaoluwa Osuntokun
29de2c8618 cmd/commands: add taproot-final to lncli open command 2026-04-13 12:21:42 -07:00
ziggie
7d90b8e755
cmd: add deletefwdhistory CLI command
In this commit, we add the lncli deletefwdhistory command that wraps
the DeleteForwardingHistory RPC. The command accepts a time
specification in one of two forms:

  --age=<duration>   relative duration, e.g. "-90d", "-1M", "-720h"
  --before=<unix>    absolute Unix timestamp in seconds

An interactive confirmation prompt is shown before deletion proceeds,
which can be suppressed with --force/-f for unattended automation.
The --batch_size flag controls events deleted per database transaction
(default 10000, max 50000).

The response is printed as JSON, consistent with other lncli commands.
2026-03-30 17:39:46 +02:00
Oli
99712e1caf
lncli: add sign subcommand to lncli wallet psbt
Adds a new sub command `lncli wallet psbt sign` to `lncli` that calls
the wallet RPC's `SignPsbt` method.
2026-03-24 13:13:43 +01:00
ziggie
3a15d7e917
multi: add omit_hops option to ListPayments RPC
Add a new omit_hops field to ListPaymentsRequest that allows clients
to skip loading hop-level route data for HTLC attempts, reducing both
query cost and response size. When set, the route is returned with
only route-level fields (TotalTimeLock, TotalAmount, SourcePubKey)
and no individual hop data or hop-level custom records.
2026-03-12 18:24:03 +01:00
saubyk
94bb665087
cmd/commands: add --include_log flag to getdebuginfo CLI
Add an --include_log boolean flag to the getdebuginfo and
encryptdebugpackage commands. When set, the log file content is included
in the response. The encryptdebugpackage command description is updated
to reflect the new default behavior.
2026-03-07 12:51:00 -08:00
Boris Nagaev
6cd785c751
lncli unlock: add unit tests
Add table-driven unit tests for unlock() that exercise success and error paths,
cover flag and arg handling.
2026-02-04 15:20:03 -05:00
Boris Nagaev
e865552cc1
lncli unlock: wait until daemon can unlock
Use the StateService stream to wait for LOCKED before sending the unlock
request, then wait for UNLOCKED/RPC_ACTIVE before reporting success.
If the state shows the wallet is already unlocked, skip sending the
unlock request and return an error immediately.

This avoids lost unlocks during slow startup.
Fix https://github.com/lightningnetwork/lnd/issues/7749
2026-02-04 15:20:03 -05:00
Slyghtning
44aa5efc66
cmd: EstimateFee for explicit inputs 2026-01-07 10:25:30 +01:00
Slyghtning
e5456d39f2
cmd: make types.go accessible in lnd package 2026-01-07 10:25:29 +01:00
Boris Nagaev
031c792b56
lncli: remove dead code
Variable chanPoints was accumulated but never used. Found with staticcheck tool.

The code is dead since 8f5d78c875
2025-11-19 21:51:40 -03:00
Andras Banki-Horvath
ac18094a09
commands: add extra warning on wallet creation 2025-09-04 15:21:28 +02:00
Oliver Gugger
37523b6cb7
Merge pull request #10100 from Abdulkbk/fix-chanid-flag
commands: fix how we parse chan ids args at CLI level
2025-07-31 06:49:46 -06:00
MPins
e6a420647c
commands: add command to delete canceled invoice
Adds the deletecanceledinvoice by payment hash command.
2025-07-25 21:21:58 -03:00
Abdullahi Yunus
754c254a4b
commands: add test for parseChanIDs
In this commit we add test for `parseChanIDs` to make sure it
parses the chan ids correctly and return errors when invalid value
is passed.

Signed-off-by: Abdullahi Yunus <abdoollahikbk@gmail.com>
2025-07-23 15:31:59 +01:00
Abdullahi Yunus
35c6cecd22
commands: use parseChanIDs method
In this commit we use the `parseChanIDs` method introduced in a
previous commit to process the `outgoing_chan_id` flag for
`queryroutes`.
2025-07-23 15:24:03 +01:00
Abdullahi Yunus
40fe9e9ce3
commands: use StringSlice flag for send payment
In this commit we replace the Int64Slice flag with StringSlice for
chan id flag, in sendpayment request.
2025-07-23 15:21:55 +01:00
Abdullahi Yunus
4751016839
commands: use StringSliceFlag for chan ids
In this commit we use stringSlice flag for incoming and outgoing
channel ids args, for forwarding history command. The Int64Slice
range does not cover all possible scids in the custom alias range.
2025-07-23 15:08:58 +01:00
Abdullahi Yunus
3c40233f83
commands: specify multiple outchan ids
In this commit we make it possible to specify outgoing_chan_id
multiple times in the same queryroutes command.
2025-07-15 18:42:43 +01:00
Gustavo Stingelin Cardoso Filho
0324902ea8
cmd/wtclient: add usage info for session and terminate commands 2025-06-30 23:06:51 -03:00
Boris Nagaev
7a70dcb36e
lnrpc: add auth_proof to graph APIs
Added flag include_auth_proof to DescribeGraph, GetNodeInfo, GetChanInfo
and the corresponding lncli commands. With the flag, these APIs add AuthProof
(signatures from the channel announcement) to the returned ChannelEdge.

This is useful to extract this data from the DB.
2025-06-19 18:19:33 -03:00
Shivam Chawla
bfe1edf4ec lnrpc: add filters to forwardhistoryrequest
This commit adds incoming and outgoing channel ids filter to forwarding history request to filter events received/forwarded from/to a particular channel
2025-06-11 09:10:13 +05:30
Oliver Gugger
fc906f2a65
Merge pull request #9127 from MPins/issue-8993
Add the option on path creator to specify the incoming channel on blinded path
2025-06-05 08:47:05 +02:00
Alex Pilon
baf2e445f4
lncli: Add --route_hints flag support
Adds --route_hints flag to sendpayment.
Hints should be JSON encoded (see usage for example).

Adds --route_hints flag to queryroutes.
Errors if blinded paths are set.
2025-05-24 20:01:45 -04:00
MPins
a7da230ffa
commands: add option to set the incoming channel on blinded path
Including the blinded path incoming channel list argument to the
addinvoice command, parsing and verifying that it has one or a
comma separeted list of channels id.
2025-05-13 17:02:44 -03:00
bitromortac
d33c92bd19
lncli: option to skip prompts for loadmc
This makes the command scriptable.
2025-05-06 11:13:30 +02:00
bitromortac
725a80a3b7
lncli: remove possibility to discard mission control from loadmc
This can already be done with resetmc and was only included here because
loadmc was used in a different context.
2025-05-06 10:59:41 +02:00
bitromortac
452022ee75
lncli: establish connection after mc parsing for loadmc
It can take some time to unmarshal large mission control data sets such
that the macaroon can expire during that phase. We postpone the
connection establishment to give the user more time to answer the
prompt.
2025-05-06 10:59:38 +02:00
bitromortac
56ccf60267
lncli: correct docs for loadmc 2025-05-06 10:53:37 +02:00
bitromortac
8351018f8b
lncli: add loadmc command
This command lets one import data exported by `lncli querymc > mc.json`
via `lncli loadmc --mcdatapath mc.json`.
2025-05-05 15:02:55 +02:00
bitromortac
180f61b9eb
lncli: change importmc category 2025-05-05 15:02:55 +02:00
yyforyongyu
d991f5659a
commands: add new field MaturityHeight 2025-04-29 13:49:22 +08:00
ziggie
729c84bee3
lncli: return more clear error msg for deletepayments 2025-04-18 15:30:39 +02:00
Oliver Gugger
04533e924c
cmd: fix incorrect error code
Fixes a bug introduced by #9605, fixes #9648.
We return a specific error in the RPC permission interceptor for the
case where the wallet is already unlocked or is still locked.
We need to catch those errors correctly to give the user a bit more
context on what to do.
2025-03-26 11:28:59 -05:00
Olaoluwa Osuntokun
67d2eac437
Merge pull request #9620 from guggero/testnet4
chain: add testnet4 support
2025-03-24 15:48:26 -07:00
Sam Korn
bb398456b5
cmd: more input parameters checks for listchaintxns cli command
add a parsing block height function and error when block heights would produce invalid results
2025-03-24 10:53:38 -06:00
Oliver Gugger
0aea482b51
multi: add testnet4 support 2025-03-24 11:53:23 -05:00
Olaoluwa Osuntokun
c292acfe74
Merge pull request #9605 from yyforyongyu/fix-unlock-wallet
cmd: fix error parsed from status
2025-03-18 11:37:35 -05:00
yyforyongyu
2d6148291f
cmd: fix error parsed from status
The `codes.Unimplemented` is only returned when the RPCs are not built.
When the wallet is in an unexpected state, `codes.Unknown` is returned
instead, so we need to catch it properly to make sure we return the
right error msg.
2025-03-17 22:59:56 +08:00
Slyghtning
1681be6d65
lncli: ip range caveat for macaroons 2025-03-13 09:57:41 -05:00
ziggie
59443faa36
multi: coop close with active HTLCs on the channel
For the lncli cmd we now always initiate the coop close even if
there are active HTLCs on the channel. In case HTLCs are on the
channel and the coop close is initiated LND handles the closing
flow in the background and the lncli cmd will block until the
transaction is broadcasted to the mempool. In the background LND
disallows any new HTLCs and waits until all HTLCs are resolved
before kicking of the negotiation process.
Moreover if active HTLCs are present and the no_wait param is not
set the error msg is now highlightning it so the user can react
accordingly.
2025-02-20 17:43:18 +01:00
ziggie
3562767b23
lncli: only add additional info to specific cmds.
We only append the chan_id and the human readable scid
for the commands `listchannels` and `closedchannels`. This
ensures that other commands like `buildroute` are not affected
by this change so their output can be piped into other cmds.

For some cmds it is not very practical to replace the json output
because we might pipe it into other commands. For example when
creating the route we want to pipe the result of buildroute into
sendtoRoute.
2025-02-12 23:29:56 +01:00
ziggie
34c4d12c71
walletrpc: add new deadline-delta param to bumpfee rpc
Add new parameter deadline-delta to the bumpfee request and only
allow it to be used when the budget value is used as well.
2025-02-07 11:28:41 +01:00
Nishant Bansal
103a194e5c
cmd/lncli: update listchannels output fields
Added scid_str as a string representation of chan_id,
replacing chan_id with scid, and including chan_id(BOLT02)
in lncli listchannels output.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-01-15 17:58:06 +05:30
Keagan McClelland
ed2989ae33
multi: update to fn v2 2024-12-04 13:19:00 -07:00