diff options
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp index 4ab8ef98ab..e47a8bb168 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -742,12 +742,21 @@ int CNetMessage::readData(const char *pch, unsigned int nBytes) vRecv.resize(std::min(hdr.nMessageSize, nDataPos + nCopy + 256 * 1024)); } + hasher.Write((const unsigned char*)pch, nCopy); memcpy(&vRecv[nDataPos], pch, nCopy); nDataPos += nCopy; return nCopy; } +const uint256& CNetMessage::GetMessageHash() const +{ + assert(complete()); + if (data_hash.IsNull()) + hasher.Finalize(data_hash.begin()); + return data_hash; +} + |