mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#25331: Add HashWriter without ser-type and ser-version and use it where possible
faf9accd66Use HashWriter where possible (MacroFake)faa5425629Add HashWriter without ser-type and ser-version (MacroFake) Pull request description: This was done in the context of https://github.com/bitcoin/bitcoin/pull/25284 , but I think it also makes sense standalone. The basic idea is that serialization type should not be initialized when it is not needed. Same for the serialization version. So do this here for `HashWriter`. `CHashWriter` remains in places where it is not yet possible. ACKs for top commit: sipa: utACKfaf9accd66Empact: utACKfaf9accd66Tree-SHA512: 544cc712436e49f6e608120bcd3ddc5ea72dd236554ce30fb6cfff34a92d7e67b6e6527336ad0f5b6365e2b2884f4c6508aef775953ccd9312f17752729703f2
This commit is contained in:
@@ -74,7 +74,7 @@ bool MessageSign(
|
||||
|
||||
uint256 MessageHash(const std::string& message)
|
||||
{
|
||||
CHashWriter hasher(SER_GETHASH, 0);
|
||||
HashWriter hasher{};
|
||||
hasher << MESSAGE_MAGIC << message;
|
||||
|
||||
return hasher.GetHash();
|
||||
|
||||
Reference in New Issue
Block a user