Skip to content

bug: invoice is not settled, but funds were received over on-chain htlc sweep #2811

@avemeva

Description

@avemeva

Background

  • User has created channel with zigzag.io.
  • User has sent lightning network payment using given by us invoice.
  • User wrote in support saying that payment was made, but service wasn't given.
  • I checked listinvoice command and it showed that invoice wasn't paid.
  • User notified that channel in which payment was made was closed.
  • I checked closedchannels command and it showed settled balance equal to zero.
  • I asked for preimage.
  • User presented preimage.
  • I have checked logs and it seems that our node has broadcasted second-layer transition tx to swipe htlc, so, payment preimage was revealed on-chain.
  • I have checked listchaintxns on a sign of sweep transaction, found it.

I need to give response to user back, because otherwise his funds in "limbo", could you clarify how could I check that I have received funds or not, so that we could provide service to user?


channel txid: 9aac89fb96aa52dcb9c59ba9fd428820a90191dc7313c0930efdcae79f7220a2
close channel txid: 3c7e84e6f635c3b708361130a5f526720bd9168a2a53ae994381b6170c11898f
our swipe htlc txid (assumption):  182e18a66e7650bb20a04884ca578d61088be70365122496a111c229a075e659
payment hash: ed9da5d9723621e322cba8160714df055a5fb173796429fc7b36015ef8657142
lncli listchaintxns | grep -C20 bc1q7lujeuy4v0e4dz2c44ak82u6hxgt0upme427dcy3l9zpkdnjqxtquf7tpx
. . . 
        {
            "tx_hash": "182e18a66e7650bb20a04884ca578d61088be70365122496a111c229a075e659",
            "amount": "0",
            "num_confirmations": 871,
            "block_hash": "000000000000000000159ba21971315a393decb320f92511fa0b99833327d63d",
            "block_height": 567239,
            "time_stamp": "1552683907",
            "total_fees": "0",
            "dest_addresses": [
                "bc1q7lujeuy4v0e4dz2c44ak82u6hxgt0upme427dcy3l9zpkdnjqxtquf7tpx"
            ]
        },
. . . 
lncli closedchannels | grep -C20 9aac89fb96aa52dcb9c59ba9fd428820a90191dc7313c0930efdcae79f7220a2

. . . 
        {
            "channel_point": "9aac89fb96aa52dcb9c59ba9fd428820a90191dc7313c0930efdcae79f7220a2:0",
            "chan_id": "623674881183055872",
            "chain_hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
            "closing_tx_hash": "3c7e84e6f635c3b708361130a5f526720bd9168a2a53ae994381b6170c11898f",
            "remote_pubkey": "033155023f4248cc522d488bccabf265a1365760de7420d03c02ffb6d8931328ce",
            "capacity": "2000000",
            "close_height": 567238,
            "settled_balance": "0",
            "time_locked_balance": "0",
            "close_type": "LOCAL_FORCE_CLOSE"
        },
. . . 

Couldn't send logs of broadcast transaction because it contains preimage, and I am not sure it is secure for now.

Your environment

  • version of lnd
    0.5.2-beta commit=v0.5.2-beta

  • which operating system (uname -a on *Nix)
    Linux b2e97bc142d1 4.4.0-142-generic Various formatting tweaks #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 Linux

  • version of btcd, bitcoind, or other backend
    bitcoind

Expected behaviour

  1. Invoice being marked as settled, if htlc is swept on-chain.
  2. Probably I am understanding "settled" balance wrong in output of closedchannels command, but it seems as if it should show non-zero settled balance, if htlc was swept.

Actual behaviour

  1. Invoice not being marked as settled.
  2. closedchannels output shows that channel has zero settled funds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions