[qa] Get rid of duplicate code #9221

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1611-qaMaxUploadDuplCode changing 3 files +19 −82
  1. MarcoFalke commented at 5:12 PM on November 25, 2016: member

    This removes some unused and duplicate code in maxuploadtarget.py

  2. MarcoFalke added the label Tests on Nov 25, 2016
  3. sdaftuar commented at 8:18 PM on November 28, 2016: member

    Perhaps you could also do a similar replacement for pruning.py, which uses this same duplicated mine_full_block() function?

  4. in qa/rpc-tests/maxuploadtarget.py:None in fa130b8f49 outdated
     133 | +        mine_large_block(self.nodes[0])
     134 |  
     135 |          # We'll be requesting this new block too
     136 |          big_new_block = self.nodes[0].getbestblockhash()
     137 | -        new_block_size = self.nodes[0].getblock(big_new_block)['size']
     138 | +        # print(self.nodes[0].getblock(big_new_block)['size'])
    


    mrbandrews commented at 5:37 PM on December 1, 2016:

    nit: think you left this in accidentally

  5. in qa/rpc-tests/pruning.py:None in fa130b8f49 outdated
      84 | @@ -95,17 +85,17 @@ def create_chain_with_staleblocks(self):
      85 |              stop_node(self.nodes[0],0)
      86 |              self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug","-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5"], timewait=900)
      87 |              # Mine 24 blocks in node 1
      88 | -            self.utxo = self.nodes[1].listunspent()
      89 | +            utxo = self.nodes[1].listunspent()
    


    mrbandrews commented at 5:37 PM on December 1, 2016:

    nit: can remove this line

  6. in qa/rpc-tests/pruning.py:None in fa130b8f49 outdated
      94 |                  else:
      95 |                      self.nodes[1].generate(1) #tx's already in mempool from previous disconnects
      96 |  
      97 |              # Reorg back with 25 block chain from node 0
      98 | -            self.utxo = self.nodes[0].listunspent()
      99 | +            utxo = self.nodes[0].listunspent()
    


    mrbandrews commented at 5:37 PM on December 1, 2016:

    same

  7. mrbandrews commented at 5:39 PM on December 1, 2016: contributor

    A couple of nits, otherwise ACK

  8. MarcoFalke renamed this:
    [qa] maxuploadtarget: Get rid of duplicate code
    [qa] Get rid of duplicate code
    on Dec 2, 2016
  9. [qa] Get rid of duplicate code facbfa5816
  10. MarcoFalke force-pushed on Dec 2, 2016
  11. MarcoFalke commented at 3:32 PM on December 2, 2016: member

    Squashed and fixed nits: fa130b8..facbfa5

  12. MarcoFalke merged this on Dec 2, 2016
  13. MarcoFalke closed this on Dec 2, 2016

  14. MarcoFalke referenced this in commit 9e4bb312e6 on Dec 2, 2016
  15. MarcoFalke deleted the branch on Dec 2, 2016
  16. morcos commented at 4:16 AM on December 4, 2016: member

    @MarcoFalke @sdaftuar @mrbandrews Did you test this? It seems to have slowed pruning.py by 35%. I don't think its worth it at the expense of adding 10 mins to the pruning.py test.

  17. MarcoFalke commented at 12:09 PM on December 4, 2016: member

    Jup, I was running the tests after squash. Will take a look at the slowdown. Should be easy to fix if this commit caused it.

  18. morcos commented at 1:55 PM on December 4, 2016: member

    @marcofalke my guess is it's the repeated calling of listunspent instead of caching the utxo's. well I should say that's the first difference I saw and then was too tired to investigate further.

  19. codablock referenced this in commit 2028e6dbdc on Jan 16, 2018
  20. codablock referenced this in commit 3b0e3741c6 on Jan 16, 2018
  21. codablock referenced this in commit 5d1f05afff on Jan 17, 2018
  22. andvgal referenced this in commit 391bd4b168 on Jan 6, 2019
  23. CryptoCentric referenced this in commit 20e609b0d2 on Feb 25, 2019
  24. DrahtBot 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-17 06:15 UTC

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