Merge #13443: Removed unused == operator from CMutableTransaction.

55771b7c6a Removed unused == operator from CMutableTransaction. (lucash.dev@gmail.com)

Pull request description:

  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')
  ```

Tree-SHA512: a565af563e09d99347b6fe419f6d48c750b1377295af293a3e0c3c0d815e58aede8d7058987a68d66cfa7ed023e5d3285b12afabd17d0ff9cf11322ba3ce20fe
This commit is contained in:
Wladimir J. van der Laan 2018-06-18 15:19:23 +02:00
commit 2d071f5a70
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D

View file

@ -388,11 +388,6 @@ struct CMutableTransaction
*/
uint256 GetHash() const;
friend bool operator==(const CMutableTransaction& a, const CMutableTransaction& b)
{
return a.GetHash() == b.GetHash();
}
bool HasWitness() const
{
for (size_t i = 0; i < vin.size(); i++) {