Skip to content

Commit 402ee70

Browse files
committed
refactor: Use proper MAX_SCRIPT_ELEMENT_SIZE const
1 parent a6f6333 commit 402ee70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/script/descriptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,8 @@ std::unique_ptr<DescriptorImpl> ParseScript(Span<const char>& sp, ParseScriptCon
815815
}
816816
}
817817
if (ctx == ParseScriptContext::P2SH) {
818-
if (script_size + 3 > 520) {
819-
error = strprintf("P2SH script is too large, %d bytes is larger than 520 bytes", script_size + 3);
818+
if (script_size + 3 > MAX_SCRIPT_ELEMENT_SIZE) {
819+
error = strprintf("P2SH script is too large, %d bytes is larger than %d bytes", script_size + 3, MAX_SCRIPT_ELEMENT_SIZE);
820820
return nullptr;
821821
}
822822
}

0 commit comments

Comments
 (0)