Change CNode::askFor to a deque #4816

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2014_09_mapaskfor_deque changing 3 files +14 −9
  1. laanwj commented at 10:07 AM on September 2, 2014: member

    AskFor() guarantees that entries will always be added with a monotonically increasing timestamp.

        int64_t nNow = GetTimeMicros() - 1000000;
        static int64_t nLastTime;
        ++nLastTime;
        nNow = std::max(nNow, nLastTime);
        nLastTime = nNow;
    

    This means that there is no need to use a map as event queue. This avoids some overhead. Also limit the maximum size of the structure. (see #4547 for further discussion)

  2. laanwj added the label P2P on Sep 2, 2014
  3. laanwj force-pushed on Sep 2, 2014
  4. Change CNode::askFor to a deque
    AskFor() guarantees that entries will always be added with a
    monotonically increasing timestamp. This means that there is no need
    to use a map as event queue. Also limit the maximum size of the structure.
    295f49569a
  5. laanwj force-pushed on Sep 2, 2014
  6. BitcoinPullTester commented at 10:36 AM on September 2, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4816_295f49569a69936899a56da07031ab7517951cbe/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  7. laanwj commented at 10:37 AM on September 2, 2014: member

    Ehm, never mind, I made a wrong assumption here (nNow is monotonically increasing - but nRequestTime is not).

  8. laanwj closed this on Sep 2, 2014

  9. rebroad commented at 2:32 AM on September 3, 2014: contributor

    heh, I think this just goes to show that the code in these areas could be a bit more readable.

  10. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me