Since the previous commit, CTransaction object calls to the
methods .rehash() and .calc_sha256() are effectively no-ops
if the returned value is not used, so we can just remove them.
This is a partial backport of core#32421
https://github.com/bitcoin/bitcoin/pull/32421/commits/9b3dce24a3336a02563412b541a3fb2003e92506
Depends on D18712