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. fanquake added the label Tests on Mar 29, 2017
  5. 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.

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

    utACK 159fe88abfadf67410578c145e631819cf50b660

  7. MarcoFalke merged this on Mar 30, 2017
  8. MarcoFalke closed this on Mar 30, 2017

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

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