aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-11-21 10:11:02 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-11-21 10:11:06 -0500
commit5ff798c39b8a72d64bd2c23f400d1c35ca27a1ed (patch)
tree8eb1961757a281d339ac4563b85817c92ca65bf3 /src/script
parentb7bc9b8330096d1f4f1fa563b855b88da425226e (diff)
parentcb9d830a00995ee60e71780c04f6193efd02c511 (diff)
downloadbitcoin-5ff798c39b8a72d64bd2c23f400d1c35ca27a1ed.tar.xz
Merge #17439: refactor: Use proper MAX_SCRIPT_ELEMENT_SIZE constants consistently
cb9d830a00995ee60e71780c04f6193efd02c511 test: Use proper MAX_SCRIPT_ELEMENT_SIZE (Hennadii Stepanov) 402ee706d8afab3d8d883cd15a660740fcebeb55 refactor: 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: ACK cb9d830a00995ee60e71780c04f6193efd02c511 -- diff looks correct and change appears to be complete instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/17439/commits/cb9d830a00995ee60e71780c04f6193efd02c511 Tree-SHA512: 5fa033275d6df7e35962c38bfdf09a7b5cd7ef2ccdd5e30a39ba47d0c21ac779a5559c23f5ef5bfd4293be0fc639e836a308bbedf0e34717e1eead983b389bbd
Diffstat (limited to 'src/script')
-rw-r--r--src/script/descriptor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp
index 13cdd6c61a..32b388b7fa 100644
--- a/src/script/descriptor.cpp
+++ b/src/script/descriptor.cpp
@@ -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;
}
}