Removed unused == operator from CMutableTransaction. #13443

pull lucash-dev wants to merge 1 commits into bitcoin:master from lucash-dev:remove-CMutableTransaction-equals changing 1 files +0 −5
  1. lucash-dev commented at 4:48 AM on June 12, 2018: contributor

    This removes the unused == operator from CMutableTransaction.

    The motivation is that unused code has a cost but offers no benefit (in general), while also adding the risk of introducing silent bugs. On top of that this particular code is quite inefficient, unnecessarily calculating the hash (it could, say, compare serializations). So if anyone ever needs to use a == comparison on CMutableTransaction, they'd be better of having to reimplement it (and add tests) than relying on code that's not being maintained.

    Note: after this, trying to use the == operator on CMutableTransactions results in a compilation error:

    ./primitives/transaction.h:405:15: error: invalid operands to binary expression ('CMutableTransaction' and
          'CMutableTransaction')
    
  2. Removed unused == operator from CMutableTransaction. 55771b7c6a
  3. fanquake added the label Refactoring on Jun 12, 2018
  4. Empact commented at 7:40 AM on June 12, 2018: member

    Can you post what happens after this change, when you try comparing CMutableTransactions?

  5. lucash-dev commented at 2:01 PM on June 12, 2018: contributor

    added to the PR description.

    ./primitives/transaction.h:405:15: error: invalid operands to binary expression ('CMutableTransaction' and
          'CMutableTransaction')
    
  6. promag commented at 3:43 PM on June 12, 2018: member

    utACK 55771b7, no strong opinion though.

  7. MarcoFalke commented at 3:47 PM on June 12, 2018: member

    utACK 55771b7, but I am with @promag on this one.

  8. Empact commented at 5:26 PM on June 12, 2018: member

    utACK 55771b7

  9. ken2812221 approved
  10. ken2812221 commented at 1:27 PM on June 15, 2018: contributor

    utACK 55771b7

  11. laanwj merged this on Jun 18, 2018
  12. laanwj closed this on Jun 18, 2018

  13. laanwj referenced this in commit 2d071f5a70 on Jun 18, 2018
  14. Fuzzbawls referenced this in commit 37ad934ad8 on Jul 28, 2019
  15. akshaynexus referenced this in commit c77af45786 on Aug 1, 2019
  16. wqking referenced this in commit 941d293047 on Apr 15, 2020
  17. 2a5A1Ghu1 referenced this in commit 767e8761c1 on Apr 21, 2020
  18. UdjinM6 referenced this in commit 5a38a1991f on Jun 20, 2021
  19. UdjinM6 referenced this in commit 94179a8f56 on Jun 24, 2021
  20. UdjinM6 referenced this in commit 12e3ba44c6 on Jun 26, 2021
  21. UdjinM6 referenced this in commit 04efdbb879 on Jun 26, 2021
  22. UdjinM6 referenced this in commit dfc1cb0e21 on Jun 26, 2021
  23. UdjinM6 referenced this in commit 5c913efd1d on Jun 28, 2021
  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-22 06:15 UTC

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