test: Add p2p test for forcerelay permission #17984

pull MarcoFalke wants to merge 3 commits into bitcoin:master from MarcoFalke:2001-qaTxForceRelay changing 4 files +64 −11
  1. MarcoFalke commented at 8:23 PM on January 22, 2020: member

    The commit test: Make msg_tx a witness tx is needed so that the python mininode does not strip the witness from transactions before sending them over p2p. The commit should also be done to keep symmetry with msg_block. See:

    • tests: Make msg_block a witness block #15982
  2. MarcoFalke force-pushed on Jan 22, 2020
  3. fanquake added the label Tests on Jan 22, 2020
  4. MarcoFalke force-pushed on Jan 23, 2020
  5. test: Make msg_tx a witness tx faf40810d7
  6. test: Fix whitespace in p2p_permissions.py fa6b57bcaa
  7. test: Add p2p test for forcerelay permission aaaae4d0eb
  8. MarcoFalke force-pushed on Jan 23, 2020
  9. MarcoFalke commented at 2:09 PM on January 23, 2020: member

    Rebased, fixed travis, and made the commit hash start with aaaa to represent the pain I endured when writing the test.

  10. in test/functional/p2p_permissions.py:133 in aaaae4d0eb
     128 | +
     129 | +        self.log.debug("Check that node[1] will send the tx to node[0] even though it is already in the mempool")
     130 | +        connect_nodes(self.nodes[1], 0)
     131 | +        with self.nodes[1].assert_debug_log(["Force relaying tx {} from whitelisted peer=0".format(txid)]):
     132 | +            p2p_rebroadcast_wallet.send_txs_and_test([tx], self.nodes[1])
     133 | +            wait_until(lambda: txid in self.nodes[0].getrawmempool())
    


    jimmysong commented at 10:23 PM on January 23, 2020:

    Is this what we really want? If the tx is already in node 0's mempool, wouldn't this always return right away?


    MarcoFalke commented at 11:08 PM on January 23, 2020:

    Oh, I think my comment is unclear. It refers to node[1]'s mempool.

    So node[1] will rebroadcast the tx from the wallet even though it is already in node[1]'s mempool


    jimmysong commented at 11:10 PM on January 23, 2020:

    ah! that makes a lot more sense.

  11. jimmysong commented at 10:24 PM on January 23, 2020: contributor

    Only 1 comment which is probably something I don't understand, so please let me know.

  12. laanwj commented at 2:40 PM on January 30, 2020: member

    ACK aaaae4d0ebd5ef34d81997a73ab9839ba7b4b9e4

  13. laanwj referenced this in commit 3b69310beb on Jan 30, 2020
  14. laanwj merged this on Jan 30, 2020
  15. laanwj closed this on Jan 30, 2020

  16. MarcoFalke deleted the branch on Jan 30, 2020
  17. sidhujag referenced this in commit 3cf24efd34 on Feb 1, 2020
  18. in test/functional/test_framework/address.py:17 in aaaae4d0eb
      12 | @@ -13,6 +13,8 @@
      13 |  
      14 |  ADDRESS_BCRT1_UNSPENDABLE = 'bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj'
      15 |  ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR = 'addr(bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj)#juyq9d97'
      16 | +# Coins sent to this address can be spent with a witness stack of just OP_TRUE
      17 | +ADDRESS_BCRT1_P2WSH_OP_TRUE = 'bcrt1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqseac85'
    


    decryp2kanon commented at 4:33 PM on October 23, 2020:

    how did you create this address? just curios :smile:

  19. sidhujag referenced this in commit bd95d473cf on Nov 10, 2020
  20. Fabcien referenced this in commit 0e28cc9f14 on Aug 24, 2021
  21. DrahtBot locked this on Feb 15, 2022

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:14 UTC

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