Ensure 2WRP by concatenating a unique string in the sighash when our fork is active

This commit is contained in:
Jonathan "Duke" Leto 2017-12-30 21:23:56 -08:00
parent fe749e06be
commit 6b6abb3d12
1 changed files with 4 additions and 0 deletions

View File

@ -1085,6 +1085,10 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig
// Serialize and hash
CHashWriter ss(SER_GETHASH, 0);
ss << txTmp << nHashType;
// This ensures Two Way Replay Protection
if (nHashType & SIGHASH_FORKID) {
ss << std::string("BTCP");
}
return ss.GetHash();
}