nervosnetwork / fiber

21 stars 11 forks source link

[send_payment] When the other node is offline, send_payment is sent. When the other node is online, send_payment will still fails. #334

Open gpBlockchain opened 3 days ago

gpBlockchain commented 3 days ago
  1. node1 open_channel node2
  2. node1 send_payment to node2 return hash
    curl --location 'http://127.0.0.1:8327' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "send_payment",
    "params": [
        {
             "target_pubkey": "035424e8c2876a35c05ac7ddb992b70530cb48ff09af7709fab445b6710733a2db",
        "amount": "0x30",
        "keysend": true
        }
    ]
    }'
    {"jsonrpc":"2.0","result":{"payment_hash":"0x3b58cb4c39582e371b1dda8d7ba6a0cc3e7b78aa7d16c28cca773a65f2610309","status":"Inflight","created_at":"0x193532604a5","last_updated_at":"0x193532604c3","failed_error":"Failed to send onion packet with error UnknownNextPeer"},"id":42}
  3. node2 stop
  4. node1 send_payment to node2 ,return no path found
    
    curl --location 'http://127.0.0.1:8327' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "send_payment",
    "params": [
        {
             "target_pubkey": "035424e8c2876a35c05ac7ddb992b70530cb48ff09af7709fab445b6710733a2db",
        "amount": "0x30",
        "keysend": true
        }
    ]
    }'

{"jsonrpc":"2.0","error":{"code":-32000,"message":"Send payment error: Failed to build route, PathFind error: no path found","data":{"target_pubkey":"035424e8c2876a35c05ac7ddb992b70530cb48ff09af7709fab445b6710733a2db","amount":"0x30","payment_hash":null,"final_htlc_expiry_delta":null,"invoice":null,"timeout":null,"max_fee_amount":null,"max_parts":null,"keysend":true,"udt_type_script":null,"allow_self_payment":null}},"id":42}%

7. node2 start
8. node1 send_payment to node2  again ,return no path found

curl --location 'http://127.0.0.1:8327' --header 'Content-Type: application/json' --data '{ "id": 42, "jsonrpc": "2.0", "method": "send_payment", "params": [ { "target_pubkey": "035424e8c2876a35c05ac7ddb992b70530cb48ff09af7709fab445b6710733a2db", "amount": "0x30", "keysend": true } ] }'

{"jsonrpc":"2.0","error":{"code":-32000,"message":"Send payment error: Failed to build route, PathFind error: no path found","data":{"target_pubkey":"035424e8c2876a35c05ac7ddb992b70530cb48ff09af7709fab445b6710733a2db","amount":"0x30","payment_hash":null,"final_htlc_expiry_delta":null,"invoice":null,"timeout":null,"max_fee_amount":null,"max_parts":null,"keysend":true,"udt_type_script":null,"allow_self_payment":null}},"id":42}

9. node1 restart
10. node1 send_payment ,return hash with err 

curl --location 'http://127.0.0.1:8327' --header 'Content-Type: application/json' --data '{ "id": 42, "jsonrpc": "2.0", "method": "send_payment", "params": [ { "target_pubkey": "035424e8c2876a35c05ac7ddb992b70530cb48ff09af7709fab445b6710733a2db", "amount": "0x30", "keysend": true } ] }'

{"jsonrpc":"2.0","result":{"payment_hash":"0x26eb2ea1457f1478e0424f9fa960ae1a337f19716357f6ebd793bd31fd00d9bf","status":"Inflight","created_at":"0x19353286bc7","last_updated_at":"0x19353286be5","failed_error":"Failed to send onion packet with error UnknownNextPeer"},"id":42}


[node1.log](https://github.com/user-attachments/files/17867741/node1.log)
[restart_node1.log](https://github.com/user-attachments/files/17867783/node1.log)