Skip to content

[bug]: SubscribeSingleInvoice and SendPaymentV2 do not wait for the channel balance to be completely updated before returning #9467

@ZZiigguurraatt

Description

@ZZiigguurraatt

Steps to reproduce (simplified by skipping channel reserve, etc.):

  1. Alice has 10 sat in channel
  2. Bob has 0 sat in channel
  3. Bob creates invoice for 1 sat and gives it to Alice
  4. Alice pays the invoice for 1 sat with SendPaymentV2 and waits for a response to include status: SUCCEEDED
  5. Alice uses ListChannels and checks and sees she now has 9 sat in the channel and bob still has 0
  6. Bob runs SubscribeSingleInvoice to wait for the invoice to be in state: SETTLED
  7. Bob uses ListChannels and checks and sees he still has 0 sat and alice now has 9 sat

However, if they both then

  1. Wait a while
  2. Check again with ListChannels, they both later see that bob has 1 sat as he should

If I follow the same process as above, but sending a taproot asset instead of sats, I'm seeing the same behaviour with the balance of taproot assets in the custom_channel_data field.

For some reason both alice and bob are taking longer to update bob's change in channel balance. It's fine if it takes longer to do that, but SubscribeSingleInvoice and SendPaymentV2 should block before returning state: SETTLED and status: SUCCEEDED.

This creates lots of confusion for the node operator and with automated testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureRelated to system design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions