mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Merge #17439: refactor: Use proper MAX_SCRIPT_ELEMENT_SIZE constants consistently
cb9d830a00test: Use proper MAX_SCRIPT_ELEMENT_SIZE (Hennadii Stepanov)402ee706d8refactor: Use proper MAX_SCRIPT_ELEMENT_SIZE const (Hennadii Stepanov) Pull request description: This PR replaces well-known "magic" numbers with proper `MAX_SCRIPT_ELEMENT_SIZE` constants. ACKs for top commit: practicalswift: ACKcb9d830a00-- diff looks correct and change appears to be complete instagibbs: utACKcb9d830a00Tree-SHA512: 5fa033275d6df7e35962c38bfdf09a7b5cd7ef2ccdd5e30a39ba47d0c21ac779a5559c23f5ef5bfd4293be0fc639e836a308bbedf0e34717e1eead983b389bbd
This commit is contained in:
@@ -815,8 +815,8 @@ std::unique_ptr<DescriptorImpl> ParseScript(Span<const char>& sp, ParseScriptCon
|
||||
}
|
||||
}
|
||||
if (ctx == ParseScriptContext::P2SH) {
|
||||
if (script_size + 3 > 520) {
|
||||
error = strprintf("P2SH script is too large, %d bytes is larger than 520 bytes", script_size + 3);
|
||||
if (script_size + 3 > MAX_SCRIPT_ELEMENT_SIZE) {
|
||||
error = strprintf("P2SH script is too large, %d bytes is larger than %d bytes", script_size + 3, MAX_SCRIPT_ELEMENT_SIZE);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user