Skip to content

Commit ecdefc5

Browse files
committed
Remove script/standard dependence of ContextualCheckDynaFedHeader
1 parent 59bed57 commit ecdefc5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/validation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3510,7 +3510,9 @@ static bool ContextualCheckDynaFedHeader(const CBlockHeader& block, CValidationS
35103510

35113511
// for v0, fedpegscript's scriptPubKey must match. v1+ is unencumbered.
35123512
if (fedpeg_version == 0) {
3513-
CScript computed_program = GetScriptForDestination(WitnessV0ScriptHash(proposed.m_fedpegscript));
3513+
uint256 fedpeg_program;
3514+
CSHA256().Write(proposed.m_fedpegscript.data(), proposed.m_fedpegscript.size()).Finalize(fedpeg_program.begin());
3515+
CScript computed_program = CScript() << OP_0 << ToByteVector(fedpeg_program);
35143516
if (computed_program != proposed.m_fedpeg_program) {
35153517
return state.Invalid(false, REJECT_INVALID, "invalid-dyna-fed", "proposed v0 segwit fedpegscript must match proposed fedpeg witness program");
35163518
}

0 commit comments

Comments
 (0)