Skip to content

[bug]: lncli sendcoins does not provide correct Amount during confirmation when using manual utxo selection and --sweepall #9225

@hazrulnizam

Description

@hazrulnizam

Background

Using lncli sendcoins while manually selecting multiple utxos using multiple --utxo flags combined with the --sweepall flag leads to the wrong confirmation Amount to be shown.

Your environment

  • lnd version 0.18.3-beta commit=v0.18.3-beta
  • Linux 4.18.0-553.22.1.el8_10.x86_64
  • Bitcoin Core v26.0.0 backend

Steps to reproduce

[bitcoin@lnd ~]$ lncli listunspent | grep 'outpoint\|amount_sat'
                        "amount_sat": 1000000,
                        "outpoint": "<txid1>:0",
                        "amount_sat": 1000000,
                        "outpoint": "<txid2>0",
                        "amount_sat": 1000000,
                        "outpoint": "<txid3>:0",
                        "amount_sat": 500000,
                        "outpoint": "<txid4>:0",

[bitcoin@lnd ~]$ lncli sendcoins --sat_per_vbyte 2 --utxo <txid1>:0 --utxo <txid2>:0 --utxo <txid3>:0 --sweepall --addr <recv_addr>
Amount: 3500000
Destination address: <recv_addr>
Confirm payment (yes/no):

Expected behaviour

The confirmation Amount should show only the sum of sats for selected UTXOs instead of the sum of sats for all available UTXOs. In the above example it should show 3000000 sats.

Actual behaviour

The confirmation prompt shows 3500000 instead as the sendcoins amount, which includes the sats for <txid4>:0 which was not included in the sendcoins command.

This is confusing because when you actually proceed with the transaction and type yes at the prompt, the sendcoins command works correctly and only sends out 3000000 sats. The bug is only visual at the confirmation prompt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended code behaviourlncli

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions