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

Store failcode of local forward failure into DB (completed) #2524

Merged
merged 8 commits into from
May 3, 2019

Commits on May 2, 2019

  1. wallet: add 'FORWARD_LOCAL_FAILED' as a new forward_status type

    In FORWARD_LOCAL_FAILED case, we can get the failcode and can't get the resolve time, that is different with FORWARD_FAILED case.
    trueptolemy committed May 2, 2019
    Configuration menu
    Copy the full SHA
    613683c View commit details
    Browse the repository at this point in the history
  2. wallet: add failcode field in forwarding struct

    It's a optional field. We only set failcode for FORWARD_LOCAL_FAILED case, and set this field with 0 in other case.
    trueptolemy committed May 2, 2019
    Configuration menu
    Copy the full SHA
    a4d72b7 View commit details
    Browse the repository at this point in the history
  3. DB: add failcode field in forwarded_payments table

    trueptolemy committed May 2, 2019
    Configuration menu
    Copy the full SHA
    0cd1814 View commit details
    Browse the repository at this point in the history
  4. wallet: store failcode by adding failcode field in wallet_forwarded_p…

    …ayment_add()
    trueptolemy committed May 2, 2019
    Configuration menu
    Copy the full SHA
    49b654c View commit details
    Browse the repository at this point in the history
  5. wallet: add failcode and case for local fail in wallet_forwarded_paym…

    …ents_get()
    trueptolemy committed May 2, 2019
    Configuration menu
    Copy the full SHA
    a25f419 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    489fac1 View commit details
    Browse the repository at this point in the history
  7. json-rpc: Add failcode info in listforwards

    trueptolemy committed May 2, 2019
    Configuration menu
    Copy the full SHA
    0e34c8e View commit details
    Browse the repository at this point in the history

Commits on May 3, 2019

  1. test_pay: Add test_forward_local_failed_stats() in 5 cases

    Here I add the test for this 5 local_failed case in this commit.
    There 5 cases for FORWARD_LOCAL_FAILED status:
        1. When Msater resolves the reply about the next peer infor(sent by Gossipd), and need handle unknown next peer failure in channel_resolve_reply();
        2. When Master handle the forward process with the htlc_in and the id of next hop, it tries to drive a new htlc_out but fails in forward_htlc();
        3. When we send htlc_out, Master asks Channeld to add a new htlc into the outgoing channel but Channeld fails. Master need handle and store this failure in rcvd_htlc_reply();
        4. When Channeld receives a new revoke message, if the state of corresponding htlc is RCVD_ADD_ACK_REVOCATION, Master will tries to resolve onionpacket and handle the failure before resolving the next hop in peer_got_revoke();
        5. When Onchaind finds the htlc time out or missing htlc, Master need handle these failure as FORWARD_LOCAL_FAILED in if it's forward payment case.
    trueptolemy committed May 3, 2019
    Configuration menu
    Copy the full SHA
    88a28d5 View commit details
    Browse the repository at this point in the history