nervosnetwork / fiber

21 stars 11 forks source link

[send_payment] return IncorrectOrUnknownPaymentDetails when Adding tlc exceeds local balance #286

Open gpBlockchain opened 4 weeks ago

gpBlockchain commented 4 weeks ago

When the balance is insufficient, calling send_payment still returns an error that cannot be analyzed for the reason; I have to check the logs to find out

curl --location 'http://127.0.0.1:8231' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "send_payment",
    "params": [
        {
            "invoice": "fibb100000000001pms3acfz8kxgfw0pnm6vkelf4qvuh77xf6ju9vp0l0m9cw5vhn6y9w4r0datuwekhct9ekhympstekd2lx5fjpxz94gsufw60s2q95xh8q8y48k7f40al7756twnkn3c5zuy0xn4za763vscf70udww4ts9t8alj484ht75xjz485x8rcqrg5w9mcm48v3u2ztxh7z5zrkdzpqr2qz2r32fldz2ppnw3qn59yndne74cse8lzgvt7qqlpfc2m9x5prt93fgklxd2wv54fhn5e8xudx9sq6frhury4suf7v8ynel22fu4944tak0tp5ksjj0tkh6jphkfs5p6zzqs6rfxwxr2m3jt8fzep39sg9qy7689pmpcqpz4xget"
        }
    ]
}'
response:
{"jsonrpc": "2.0", "error": {"code": -32000, "message": "Send payment error: Failed to send onion packet with error \"IncorrectOrUnknownPaymentDetails\"", "data": {"target_pubkey": null, "amount": null, "payment_hash": null, "final_cltv_delta": null, "invoice": "fibb100000000001pms3acfz8kxgfw0pnm6vkelf4qvuh77xf6ju9vp0l0m9cw5vhn6y9w4r0datuwekhct9ekhympstekd2lx5fjpxz94gsufw60s2q95xh8q8y48k7f40al7756twnkn3c5zuy0xn4za763vscf70udww4ts9t8alj484ht75xjz485x8rcqrg5w9mcm48v3u2ztxh7z5zrkdzpqr2qz2r32fldz2ppnw3qn59yndne74cse8lzgvt7qqlpfc2m9x5prt93fgklxd2wv54fhn5e8xudx9sq6frhury4suf7v8ynel22fu4944tak0tp5ksjj0tkh6jphkfs5p6zzqs6rfxwxr2m3jt8fzep39sg9qy7689pmpcqpz4xget", "timeout": null, "max_fee_amount": null, "max_parts": null, "keysend": null, "udt_type_script": null}}, "id": 42}

  2024-10-24T07:03:06.431421Z ERROR fnn::fiber::channel: Error while processing channel command: InvalidParameter("Adding tlc Offered(0) with amount 11000000000 exceeds local balance 10000000000")
    at src/fiber/channel.rs:1815
    in ractor::actor::Actor with id: "0.5"

  2024-10-24T07:03:06.432162Z ERROR fnn::fiber::network: Failed to send onion packet with error: 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, 98, 52, 52, 100, 51, 102, 98, 98, 55, 102, 53, 99, 52, 98, 56, 54, 51, 57, 99, 57, 100, 48, 56, 99, 99, 49, 49, 102, 55, 52, 54, 54, 56, 56, 49, 53, 54, 56, 48, 49, 51, 52, 100, 57, 98, 52, 50, 100, 53, 50, 50, 99, 57, 56, 51, 99, 54, 51, 54, 54, 50, 48, 99, 99, 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] }
    at src/fiber/network.rs:2301
    in ractor::actor::Actor with id: "0.2", name: "Network QmbZhr3B2e6t97c6fLXrLR4QuWEdZxxsciCKeAkcLLh9nD"

  2024-10-24T07:03:06.432250Z ERROR fnn::fiber::network: Failed to send payment: SendPaymentError("Failed to send onion packet with error \"IncorrectOrUnknownPaymentDetails\"")
    at src/fiber/network.rs:1573
    in ractor::actor::Actor with id: "0.2", name: "Network QmbZhr3B2e6t97c6fLXrLR4QuWEdZxxsciCKeAkcLLh9nD"

  2024-10-24T07:03:06.432310Z ERROR fnn::rpc::channel: channel request params SendPaymentCommandParams { target_pubkey: None, amount: None, payment_hash: None, final_cltv_delta: None, invoice: Some("fibb100000000001pms3acfz8kxgfw0pnm6vkelf4qvuh77xf6ju9vp0l0m9cw5vhn6y9w4r0datuwekhct9ekhympstekd2lx5fjpxz94gsufw60s2q95xh8q8y48k7f40al7756twnkn3c5zuy0xn4za763vscf70udww4ts9t8alj484ht75xjz485x8rcqrg5w9mcm48v3u2ztxh7z5zrkdzpqr2qz2r32fldz2ppnw3qn59yndne74cse8lzgvt7qqlpfc2m9x5prt93fgklxd2wv54fhn5e8xudx9sq6frhury4suf7v8ynel22fu4944tak0tp5ksjj0tkh6jphkfs5p6zzqs6rfxwxr2m3jt8fzep39sg9qy7689pmpcqpz4xget"), timeout: None, max_fee_amount: None, max_parts: None, keysend: None, udt_type_script: None } => error: "Send payment error: Failed to send onion packet with error \"IncorrectOrUnknownPaymentDetails\""
    at src/rpc/channel.rs:529

  2024-10-24T07:07:59.702385Z DEBUG fnn::fiber::channel: Not including TLC Received(0) to commitment transction as it is already removed
    at src/fiber/channel.rs:3737

  2024-10-24T07:07:59.702729Z DEBUG fnn::fiber::channel: Not including TLC Received(0) to commitment transction as it is already removed
    at src/fiber/channel.rs:3737```