Skip to content

Commit

Permalink
script: Do not forget about nTime when calculating SignatureHash
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Nov 5, 2023
1 parent 3e15953 commit 14f1fb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,10 @@ uint256 SignatureHash(const CScript& scriptCode, const T& txTo, unsigned int nIn
HashWriter ss{};
// Version
ss << txTo.nVersion;
if (txTo.nVersion < 2) {
// nTime
ss << txTo.nTime;
}
// Input prevouts/nSequence (none/all, depending on flags)
ss << hashPrevouts;
ss << hashSequence;
Expand Down

0 comments on commit 14f1fb9

Please sign in to comment.