Skip to content

Commit 2d071f5

Browse files
committed
Merge #13443: Removed unused == operator from CMutableTransaction.
55771b7 Removed unused == operator from CMutableTransaction. ([email protected]) 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
2 parents d67eff8 + 55771b7 commit 2d071f5

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/primitives/transaction.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,6 @@ struct CMutableTransaction
388388
*/
389389
uint256 GetHash() const;
390390

391-
friend bool operator==(const CMutableTransaction& a, const CMutableTransaction& b)
392-
{
393-
return a.GetHash() == b.GetHash();
394-
}
395-
396391
bool HasWitness() const
397392
{
398393
for (size_t i = 0; i < vin.size(); i++) {

0 commit comments

Comments
 (0)