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

Fix last contacted #3286

Merged
merged 3 commits into from
May 25, 2021
Merged

Commits on May 14, 2021

  1. network.last_contacted: rename channel2 to channel0

    This is done so that node numbering numbering matches the channel
    numbering, which makes easy to determine which channel belongs to which
    node.
    dsiganos committed May 14, 2021
    Configuration menu
    Copy the full SHA
    ff6ef82 View commit details
    Browse the repository at this point in the history
  2. Fix unit test network.last_contacted (nanocurrency#3285)

    The unit test network.last_contacted has the following problems:
    
    * regular keepalive messages sent automatically can interfere with the test
    * the test should wait for the clock to move at least one tick to eliminate the possibility of the clock not having the time to move forward
    * the test waits for a the keepalive counter to be incremented and then expects the last_packet_received timestamp to be updated but the timestamp is updated after the counter is incremented, which is a race condition
    
    The solution:
    * send a second keepalive to handle the race condition between setting the timestamp and incrementing the counter
    * send a third keepalive to handle the case where an automatic keepalive message is already in flight
    * wait for the clock to move after reading it and before continuing
    
    Assumptions:
    We assume that there will be no more than 1 keelalive in flight.
    Of course, in theory, there could be multiple keepalives queued up but
    for the purposes of this test, we assume max 1 keepalive in flight.
    It is not an unreasonable assumption in this test case.
    dsiganos committed May 14, 2021
    Configuration menu
    Copy the full SHA
    3f4da62 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    39bedc5 View commit details
    Browse the repository at this point in the history