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

self-payment fails when both channels have zero remote_balance #355

Closed
ahonn opened this issue Nov 29, 2024 · 3 comments · Fixed by #432
Closed

self-payment fails when both channels have zero remote_balance #355

ahonn opened this issue Nov 29, 2024 · 3 comments · Fixed by #432

Comments

@ahonn
Copy link

ahonn commented Nov 29, 2024

When both channels A(100)->B(0) and B(100)->A(0) have a remote_balance of 0, self-payment fails with the error message: Send payment error: Failed to send onion packet with error IncorrectOrUnknownPaymentDetails.

It looks like both the remote_balance and local_balance of these two channels need to be sufficient for a successful self-payment, which seems illogical.

After many tests, this problem still occurs.

ref: #300 (comment)

@ahonn
Copy link
Author

ahonn commented Nov 29, 2024

  • start two new nodes and open two channels A(100)->B(0) and B(100)->A
  • new invoice on node A
  • send payment on node A to self (with the "allow_self_payment": true parameter), an error occurred
  • send payment from node A to node B, making self payment normal after A(40) -> B(60).

@chenyukang
Copy link
Collaborator

can you upload the logs when error happen?

@gpBlockchain
Copy link
Contributor

channel
channel1:a(1000)-b(10)
channel2:a(0)-b(1000)

  1. node1.send_payment(node1,keysend,dry_run,allow_self_payment ) return succ
  2. node1.send_payment(node1,keysend,allow_self_payment ) return Inflight
  3. list_channel ,offered_tlc_balance != 0x0
{"jsonrpc": "2.0", "result": {"channels": [{"channel_id": "0x68821150e5c60b9a25ece0b15a9efec0cb0dce27e094a1fde643f3dc34876d7c", "is_public": true, "channel_outpoint": "0x8bf10f1a014afdda2a5c2e3a7a96c519092651b5ff26a60561b481730f3eb3c600000000", "peer_id": "QmYwYM7R4RJDfS57x9rGNZGs4oXSjgvgdRyomuhCbNLRjq", "funding_udt_type_script": null, "state": {"state_name": "CHANNEL_READY", "state_flags": []}, "local_balance": "0x0", "offered_tlc_balance": "0x0", "remote_balance": "0x15d6ea6a00", "received_tlc_balance": "0x0", "created_at": "0x19385417cba"}, {"channel_id": "0xacc523dfc3e919d40aa0f555a39e9a78ccb575f9fde350b2e3b3717c39d8f793", "is_public": true, "channel_outpoint": "0x7f87ccf5941dc1c26b0ab21036ed96f216740ccdec6b4dc069114a2a0736da2800000000", "peer_id": "QmYwYM7R4RJDfS57x9rGNZGs4oXSjgvgdRyomuhCbNLRjq", "funding_udt_type_script": null, "state": {"state_name": "CHANNEL_READY", "state_flags": []}, "local_balance": "0x15d6ea6a00", "offered_tlc_balance": "0x12a523d40", "remote_balance": "0x0", "received_tlc_balance": "0x0", "created_at": "0x193854150fa"}, {"channel_id": "0xf9b99b74e3a7ae1ca52ffe8223a061c2a49dc4b5371e3ab07b70b82fabc27196", "is_public": true, "channel_outpoint": "0x1dce5325ba1636b06607f831da9a5cf58f3c924f293ef12ac0173d969af0880600000000", "peer_id": "QmYwYM7R4RJDfS57x9rGNZGs4oXSjgvgdRyomuhCbNLRjq", "funding_udt_type_script": null, "state": {"state_name": "CHANNEL_READY", "state_flags": []}, "local_balance": "0x159b4fa000", "offered_tlc_balance": "0x0", "remote_balance": "0x3b9aca00", "received_tlc_balance": "0x0", "created_at": "0x19385400ca9"}]}, "id": 42}

err in b log

  2024-12-02T02:48:48.925210Z ERROR fnn::fiber::channel: Error while processing channel command: InvalidParameter("Adding tlc Offered(0) with amount 5000000000 exceeds local balance 1000000000")
    at src/fiber/channel.rs:1847
    in ractor::actor::Actor with id: "0.5"

  2024-12-02T02:48:48.925526Z ERROR fnn::fiber::channel: Error forwarding onion packet: TlcErrPacket { onion_packet: [123, 10, 32, 32, 34, 101, 114, 114, 111, 114, 95, 99, 111, 100, 101, 34, 58, 32, 34, 73, 110, 99, 111, 114, 114, 101, 99, 116, 79, 114, 85, 110, 107, 110, 111, 119, 110, 80, 97, 121, 109, 101, 110, 116, 68, 101, 116, 97, 105, 108, 115, 34, 44, 10, 32, 32, 34, 101, 120, 116, 114, 97, 95, 100, 97, 116, 97, 34, 58, 32, 123, 10, 32, 32, 32, 32, 34, 67, 104, 97, 110, 110, 101, 108, 70, 97, 105, 108, 101, 100, 34, 58, 32, 123, 10, 32, 32, 32, 32, 32, 32, 34, 99, 104, 97, 110, 110, 101, 108, 95, 111, 117, 116, 112, 111, 105, 110, 116, 34, 58, 32, 34, 48, 120, 49, 100, 99, 101, 53, 51, 50, 53, 98, 97, 49, 54, 51, 54, 98, 48, 54, 54, 48, 55, 102, 56, 51, 49, 100, 97, 57, 97, 53, 99, 102, 53, 56, 102, 51, 99, 57, 50, 52, 102, 50, 57, 51, 101, 102, 49, 50, 97, 99, 48, 49, 55, 51, 100, 57, 54, 57, 97, 102, 48, 56, 56, 48, 54, 48, 48, 48, 48, 48, 48, 48, 48, 34, 44, 10, 32, 32, 32, 32, 32, 32, 34, 99, 104, 97, 110, 110, 101, 108, 95, 117, 112, 100, 97, 116, 101, 34, 58, 32, 110, 117, 108, 108, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 10, 125] }

a log: node.log
b log: node.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants