Skip to content

[bug]: lncli lookupinvoice shows amt_paid_sat when assets were sent #1607

Open
@ZZiigguurraatt

Description

@ZZiigguurraatt

Consider the following network

                       TAP
Alice <-------> Bob <-------> Charlie
         SAT           SAT
  1. Charlie creates an invoice for 235400 assets and sends it to Alice. The invoice says 2389 sat.
  2. Alice pays the invoice for 2389 sat
  3. Charlie receives 235399 asset.
  4. Charlie runs lncli lookupinvoice bc7b5132dbc28ee0192f522ad99a66268df5652ca7c72179894bad2c71b1c7b8
  5. Charlie gets
{
    "memo": "",
    "r_preimage": "48de07718f7ef02f45ad32ae072963282377dbb437a50ae5094e3ae48a90dde8",
    "r_hash": "bc7b5132dbc28ee0192f522ad99a66268df5652ca7c72179894bad2c71b1c7b8",
    "value": "2389",
    "value_msat": "2389310",
    "settled": true,
    "creation_date": "1750190455",
    "settle_date": "1750190455",
    "payment_request": "lnbcrt23893100p1p59rjthpp5h3a4zvkmc28wqxf02g4dnxnxy6xl2efv5lrjz7vffwkjcud3c7uqdqqcqzzsxqyz5vqrzjqvry9fl47uswkl5203wpq9dskj04k8dd4kjg47zjmfnwyxunxnsgdaemye32c36mlqqqqqlgqqqqqqgq2qsp5jflvcec9p7j9f5cgdq6gur6w2enesg79248g92age278fe4c7emq9qxpqysgqkwf60vft36n4wv5z9heh6yy2n67ahecg2s4cv24zafvzjgxccaf3sxkqcwly48mpqfta7pnm77n57chs0geucexc2xphy9pze4jvmjqqdvrpfp",
    "description_hash": "",
    "expiry": "86400",
    "fallback_addr": "",
    "cltv_expiry": "80",
    "route_hints": [
        {
            "hop_hints": [
                {
                    "node_id": "030642a7f5f720eb7e8a7c5c1015b0b49f5b1dadada48af852da66e21b9334e086",
                    "chan_id": "17814874956233137144",
                    "fee_base_msat": 1000,
                    "fee_proportional_millionths": 1,
                    "cltv_expiry_delta": 80
                }
            ]
        }
    ],
    "private": true,
    "add_index": "8",
    "settle_index": "8",
    "amt_paid": "2389310",
    "amt_paid_sat": "2389",
    "amt_paid_msat": "2389310",
    "state": "SETTLED",
    "htlcs": [
        {
            "chan_id": "716881581375488",
            "htlc_index": "3",
            "amt_msat": "2389310",
            "accept_height": 701,
            "accept_time": "1750190455",
            "resolve_time": "1750190455",
            "expiry_height": 784,
            "state": "SETTLED",
            "custom_records": {
                "65536": "012c0020172a97a7ce2d0a5e234282cd4028530dba831efd5f7a0f2394c48e781e4d5fd601080000000000039787",
                "65538": "5617394fd5934a13eaacecfd28260ff9ec254effd85e236df73b2662ac475bf8",
                "65543": "006c016a0020172a97a7ce2d0a5e234282cd4028530dba831efd5f7a0f2394c48e781e4d5fd6014060135ceb00ac4c53a782b419cea282e58ce8e1a1b39e7761a71e44b10ccdcce44577c412b2fa36ac962ebf04b29f53e0b73a0f1f40ccbe49dca0a3ece13be480020400000083",
                "106823": "00"
            },
            "mpp_total_amt_msat": "2389310",
            "amp": null,
            "custom_channel_data": {
                "balances": [
                    {
                        "asset_id": "172a97a7ce2d0a5e234282cd4028530dba831efd5f7a0f2394c48e781e4d5fd6",
                        "amount": 235399
                    }
                ],
                "rfq_id": "5617394fd5934a13eaacecfd28260ff9ec254effd85e236df73b2662ac475bf8"
            }
        }
    ],
    "features": {
        "8": {
            "name": "tlv-onion",
            "is_required": true,
            "is_known": true
        },
        "14": {
            "name": "payment-addr",
            "is_required": true,
            "is_known": true
        },
        "17": {
            "name": "multi-path-payments",
            "is_required": false,
            "is_known": true
        },
        "25": {
            "name": "route-blinding",
            "is_required": false,
            "is_known": true
        }
    },
    "is_keysend": false,
    "payment_addr": "927ecc67050fa454d30868348e0f4e56679823c5554e82aba8cabc74e6b8f676",
    "is_amp": false,
    "amp_invoice_state": {},
    "is_blinded": false,
    "blinded_path_config": null
}

which is confusing to Charlie because his node tells him

    "amt_paid": "2389310",
    "amt_paid_sat": "2389",
    "amt_paid_msat": "2389310",

but I think these should all be 0 because he received assets and not sats.

However, I think that

    "value": "2389",
    "value_msat": "2389310",

should still be as is because they are the value of the asset and the invoice, but not necessarily an amount paid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions