Merge #9045: Hash P2P messages as they are received instead of at process-time

fe1dc62 Hash P2P messages as they are received instead of at process-time (Matt Corallo)
This commit is contained in:
Pieter Wuille
2016-11-07 14:12:26 -08:00
3 changed files with 15 additions and 1 deletions

View File

@@ -543,6 +543,9 @@ public:
class CNetMessage {
private:
mutable CHash256 hasher;
mutable uint256 data_hash;
public:
bool in_data; // parsing header (false) or data (true)
@@ -570,6 +573,8 @@ public:
return (hdr.nMessageSize == nDataPos);
}
const uint256& GetMessageHash() const;
void SetVersion(int nVersionIn)
{
hdrbuf.SetVersion(nVersionIn);