Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show funds in pending htlcs as pending in getbalance #1684

Open
kilrau opened this issue Jun 23, 2020 · 5 comments
Open

Show funds in pending htlcs as pending in getbalance #1684

kilrau opened this issue Jun 23, 2020 · 5 comments
Assignees
Labels
P1 top priority swaps

Comments

@kilrau
Copy link
Contributor

kilrau commented Jun 23, 2020

Follow-up of #1680, needed for #1673: since we now treat a swap as atomically completed upon reaching PreimageResolved from maker's perspective, we should show balance that is currently in swap recovery with xud trying to claim the htlc but still didn't manage to do so (and might go on-chain at some point) as pending in getbalance.

In other words: in addition to new pending channels, any balance in pending htlc should show as pending under getbalance.

Currently this balance isn't shown anywhere and the user would see a successfully completed swap, deducted outgoing asset balance, but nothing added for the incoming asset's balance (where is my money?).

@kilrau kilrau added P2 mid priority swaps labels Jun 23, 2020
@kilrau kilrau changed the title Show balance as pending between preimageResolved and `PaymentReceiv Show incoming balance between preimageResolved and PaymentReceived as pending Jun 23, 2020
@kilrau kilrau changed the title Show incoming balance between preimageResolved and PaymentReceived as pending Show pending funds as pending in getbalance Jul 23, 2020
@kilrau kilrau added P1 top priority and removed P2 mid priority labels Jul 23, 2020
@kilrau
Copy link
Contributor Author

kilrau commented Jul 23, 2020

For example funds from this failed swap don't show anywhere in xud:

lndbtc:

            "pending_htlcs": [
                {
                    "incoming": true,
                    "amount": "10000",
                    "hash_lock": "928a7b6caf95b590b78db560db427dd6731a2f208c11b394ede420599ba3e927",
                    "expiration_height": 640526
                }
            ],

connext:

bash-5.0# curl -H 'Content-Type: application/json' http://0.0.0.0:5040/hashlock-status/0x928a7b6caf95b590b78db560db427dd6731a2f208c11b394ede420599ba3e927/0x0000000000000000000000000000000000000000 | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   438  100   438    0     0    863      0 --:--:-- --:--:-- --:--:--   863
{
  "senderIdentifier": "indraABC",
  "receiverIdentifier": "indraABC",
  "assetId": "0x0000000000000000000000000000000000000000",
  "amount": "100000000000000",
  "lockHash": "0x928a7b6caf95b590b78db560db427dd6731a2f208c11b394ede420599ba3e927",
  "status": "PENDING",
  "preImage": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "expiry": "10517875"
}

@ghost
Copy link

ghost commented Jul 24, 2020

Getting the amount of funds locked up via /hashlock-status endpoint might not be the best solution because of the complexity it adds on xud level to track the payments. Perhaps connext client can consider displaying this information in the response of /balance endpoint? Or a more general /getinfo endpoint?

@kilrau
Copy link
Contributor Author

kilrau commented Jul 24, 2020

Agree. Wdyt? @ArjunBhuptani

@kilrau
Copy link
Contributor Author

kilrau commented Jul 27, 2020

Also, currently the connext client doesn't seem to account for funds locked in an htlc. The balance reported is still the same. We propose to add 4 different balances to the connext client (either in one /balance endpoint or 4 different endpoints ):

  1. off-chain
  2. off-chain pending
  3. on-chain
  4. on-chain pending

@kilrau kilrau added P2 mid priority and removed P1 top priority labels Aug 3, 2020
@kilrau
Copy link
Contributor Author

kilrau commented Aug 3, 2020

Moved this to P2 since we are depending on changes from connext side: connext/rest-api-client#66

@kilrau kilrau added P1 top priority and removed P2 mid priority labels Oct 8, 2020
@kilrau kilrau changed the title Show pending funds as pending in getbalance Show funds in pending htlcs as pending in getbalance Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 top priority swaps
Projects
None yet
Development

No branches or pull requests

2 participants