Remove SingleNodeConnCB #10109

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:remove_single_node_conn_cb changing 14 files +79 −85
  1. jnewbery commented at 6:21 PM on March 28, 2017: member

    This PR merges the NodeConnCB and SingleNodeConnCB into a single class (called NodeConnCB). The original intent for the NodeConnCB was to be able to have a python 'mininode' connect to multiple running bitcoinds. This has never been used and can be achieved more easily by having multiple NodeConns backed by a common datastore if it is ever needed.

    The changes in mininode.py are just code moves (and merging the two classes into a single class). The code changes in the individual test cases are changing the subclasses to subclass from NodeConnCB instead of SingleNodeConnCB. There is a lot of duplicate code in the subclasses that can be removed in future commits. @sdaftuar as discussed - should be an easy review.

  2. Remove SingleNodeConnCB
    This commit merges the NodeConnCB and SingleNodeConnCB into a single
    class (called NodeConnCB). The original intent for the NodeConnCB was to
    be able to have a python 'mininode' connect to multiple running
    bitcoinds. This has never been used and can be achieved more easily by
    having multiple NodeConns backed by a common datastore if it is ever
    needed.
    
    The changes in mininode.py are just code moves (and merging the two
    classes into a single class). The code changes in the individual test
    cases are changing the subclasses to subclass from NodeConnCB instead of
    SingleNodeConnCB. There is a lot of duplicate code in the subclasses
    that can be removed in future commits.
    159fe88abf
  3. sdaftuar commented at 6:53 PM on March 28, 2017: member

    utACK 159fe88. Thanks for tackling!

  4. jnewbery cross-referenced this on Mar 28, 2017 from issue [WIP] Remove NetworkThread from individual test cases by jnewbery
  5. fanquake added the label Tests on Mar 29, 2017
  6. jnewbery cross-referenced this on Mar 29, 2017 from issue [tests] sync_with_ping should assert that ping hasn't timed out by jnewbery
  7. in test/functional/test_framework/mininode.py:1518 in 159fe88abf
    1523 | +    def on_getblocktxn(self, conn, message): pass
    1524 | +    def on_getdata(self, conn, message): pass
    1525 | +    def on_getheaders(self, conn, message): pass
    1526 | +    def on_headers(self, conn, message): pass
    1527 | +    def on_mempool(self, conn): pass
    1528 | +    def on_open(self, conn): pass
    


    MarcoFalke commented at 7:22 AM on March 30, 2017:

    style nit: Any reason you don't mention on_pong here?


    jnewbery commented at 12:37 PM on March 30, 2017:

    I put all the no-op callbacks in this block and the callbacks that do something below. Happy to move them around if you think that's unclear.

  8. MarcoFalke commented at 7:22 AM on March 30, 2017: member

    utACK 159fe88abfadf67410578c145e631819cf50b660

  9. MarcoFalke merged this on Mar 30, 2017
  10. MarcoFalke closed this on Mar 30, 2017

  11. MarcoFalke referenced this in commit 8ac8041286 on Mar 30, 2017
  12. PastaPastaPasta referenced this in commit b7fe68bb54 on Mar 14, 2019
  13. PastaPastaPasta referenced this in commit bbaffa34cc on May 20, 2019
  14. PastaPastaPasta referenced this in commit a9e4f4b5a8 on May 20, 2019
  15. PastaPastaPasta referenced this in commit cc06ef5514 on May 21, 2019
  16. PastaPastaPasta referenced this in commit 95f9b391cd on May 21, 2019
  17. barrystyle referenced this in commit a95de0bd1f on Jan 22, 2020
  18. bitcoin 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-05-20 06:55 UTC