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

[send_payment] return IncorrectOrUnknownPaymentDetails when use wrong channel #359

Open
gpBlockchain opened this issue Dec 2, 2024 · 1 comment

Comments

@gpBlockchain
Copy link
Contributor

gpBlockchain commented Dec 2, 2024

When node 1 has multiple channels and the amount it needs to send only meets the requirements of some of them, it might select the wrong channel and cause an error.

  1. open_chanel: a1(1000)-b1(0)
  2. open_chanel: a1(0) - b1(1000)
  3. nodeA send_payment (nodeB, 100,dry_run) return true
curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "send_payment",
    "params": [
        {
            "target_pubkey": "0357bb625046c60eeaec070b52cb0479b2380ea6a88ca426f3cf08fdd644839cf9",
            "amount": "0x2540be400",
            "keysend": true,
            "dry_run": true
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"payment_hash": "0x5d7f9780693a2110beac392b0ae630ba93747118a54ca8aaa68d694b5e157603", "status": "Created", "created_at": "0x19385700ea8", "last_updated_at": "0x19385700ea8", "failed_error": null, "fee": "0x0"}, "id": 42}

  1. nodeA send_payment (nodeB, 100) return IncorrectOrUnknownPaymentDetails
curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "send_payment",
    "params": [
        {
            "target_pubkey": "0357bb625046c60eeaec070b52cb0479b2380ea6a88ca426f3cf08fdd644839cf9",
            "amount": "0x2540be400",
            "keysend": true
        }
    ]
}'
response:
{"jsonrpc": "2.0", "error": {"code": -32000, "message": "Send payment error: Failed to send onion packet with error IncorrectOrUnknownPaymentDetails", "data": {"target_pubkey": "0357bb625046c60eeaec070b52cb0479b2380ea6a88ca426f3cf08fdd644839cf9", "amount": "0x2540be400", "payment_hash": null, "final_tlc_expiry_delta": null, "tlc_expiry_limit": null, "invoice": null, "timeout": null, "max_fee_amount": null, "max_parts": null, "keysend": true, "udt_type_script": null, "allow_self_payment": null, "dry_run": null}}, "id": 42}

  1. nodeB send_payment (nodeA, 100) return success

log

  2024-12-02T03:35:33.819477Z ERROR fnn::fiber::channel: Error while processing channel command: InvalidParameter("Adding tlc Offered(0) with amount 10000000000 exceeds local balance 0")
    at src/fiber/channel.rs:1847
    in ractor::actor::Actor with id: "0.6"

  2024-12-02T03:35:33.819754Z ERROR fnn::fiber::network: Failed to send payment: SendPaymentError("Failed to send onion packet with error IncorrectOrUnknownPaymentDetails")
    at src/fiber/network.rs:1596
    in ractor::actor::Actor with id: "0.2", name: "Network QmRyC6XQyuSGi1dcuzBy5KM6VLdH7BAoH7EEq3e2JVR8AP"

  2024-12-02T03:35:33.819789Z ERROR fnn::rpc::channel: channel request params SendPaymentCommandParams { target_pubkey: Some(Pubkey(PublicKey(f99c8344d6fd08cff326a48ca8a60e38b27904cb520b07ecea0ec6465062bb57f1777fb85af1a72cbdee702156fcdb4e590bafda4a348b0943576f7074cd48e2))), amount: Some(10000000000), payment_hash: None, final_tlc_expiry_delta: None, tlc_expiry_limit: None, invoice: None, timeout: None, max_fee_amount: None, max_parts: None, keysend: Some(true), udt_type_script: None, allow_self_payment: None, dry_run: None } => error: "Send payment error: Failed to send onion packet with error IncorrectOrUnknownPaymentDetails"
    at src/rpc/channel.rs:703

node.log

@gpBlockchain
Copy link
Contributor Author

#355

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

No branches or pull requests

1 participant