Browse Source

Remove GetSerializeHash() method.

pull/145/head
Simon 8 years ago
parent
commit
74cd8821c7
  1. 12
      src/primitives/transaction.cpp
  2. 11
      src/primitives/transaction.h

12
src/primitives/transaction.cpp

@ -116,11 +116,6 @@ CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.n
}
uint256 CMutableTransaction::GetSerializeHash() const
{
return SerializeHash(*this);
}
void CTransaction::UpdateHash() const
{
*const_cast<uint256*>(&hash) = SerializeHash(*this);
@ -214,8 +209,8 @@ std::string CTransaction::ToString() const
{
std::string str;
str += strprintf("CTransaction(txid=%s, hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
GetTxid().ToString().substr(0,10),
GetSerializeHash().ToString().substr(0,10),
txid.ToString().substr(0,10),
hash.ToString().substr(0,10),
nVersion,
vin.size(),
vout.size(),
@ -245,8 +240,7 @@ void CTransaction::UpdateTxid() const
tx.joinSplitSig.assign(0);
}
// Return double SHA256 hash
*const_cast<uint256*>(&txid) = tx.GetSerializeHash();
*const_cast<uint256*>(&txid) = SerializeHash(tx);
}
// Return a txid which is non-malleable.

11
src/primitives/transaction.h

@ -343,10 +343,6 @@ public:
return vin.empty() && vout.empty();
}
const uint256& GetSerializeHash() const {
return hash;
}
// Return sum of txouts.
CAmount GetValueOut() const;
// GetValueIn() is a method on CCoinsViewCache, because
@ -416,12 +412,9 @@ struct CMutableTransaction
}
}
/** Compute the hash of this CMutableTransaction. This is computed on the
* fly, as opposed to GetSerializeHash() in CTransaction, which uses a cached result.
/** Compute the non-malleable txid of this CMutableTransaction. This is computed on the
* fly, as opposed to GetTxid() in CTransaction, which uses a cached result.
*/
uint256 GetSerializeHash() const;
// Compute a non-malleable txid on the fly.
uint256 GetTxid() const;
};

Loading…
Cancel
Save