Skip to content

Commit dc29f85

Browse files
authored
Merge pull request #1697 from evoskuil/master
Fix v1 sig hash for anyone_can_pay (prevout script).
2 parents e3e49b0 + 44f9568 commit dc29f85

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/chain/transaction_sighash_v1.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ bool transaction::version1_sighash(hash_digest& out,
106106

107107
if (anyone)
108108
{
109+
// This implies a parameterization error, and will fail the script.
110+
if (is_null(in.prevout))
111+
return false;
112+
109113
in.point().to_data(sink);
110114
sink.write_8_bytes_little_endian(value);
111-
script.to_data(sink, true);
115+
in.prevout->script().to_data(sink, true);
112116
sink.write_4_bytes_little_endian(in.sequence());
113117
}
114118
else

0 commit comments

Comments
 (0)