aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-11-07 14:12:26 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-11-07 14:19:44 -0800
commit9f554e03ebe5701c1b75ff03b3d6152095c0cad3 (patch)
tree1b71c507fc134b726c5bf39ec48e31396c936568 /src/net.h
parent1253f8692fc3a11be9430685cd405236a68df6c3 (diff)
parentfe1dc62cef88280d2490a619beded052f313c6fc (diff)
downloadbitcoin-9f554e03ebe5701c1b75ff03b3d6152095c0cad3.tar.xz
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)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 22b80fc504..e712953be3 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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);