aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-05-03 12:36:56 -0400
committerAva Chow <github@achow101.com>2024-05-03 12:36:56 -0400
commitf5b6f621fff7540ca97974b26a66ca1cc6db018c (patch)
tree911c114e6f8b7bb9ef2ba71831f5f22b8bba0d06
parentf9486de6a96b624982a2d45b895bfe4e865063d1 (diff)
parentffc674595cb19b2fdc5705b355bdd3e7f724b860 (diff)
downloadbitcoin-f5b6f621fff7540ca97974b26a66ca1cc6db018c.tar.xz
Merge bitcoin/bitcoin#30024: doc: replace remaining "520" magic nums with MAX_SCRIPT_ELEMENT_SIZE
ffc674595cb19b2fdc5705b355bdd3e7f724b860 Replace remaining "520" magic numbers with MAX_SCRIPT_ELEMENT_SIZE (Jon Atack) Pull request description: Noticed these while reviewing BIPs yesterday. It would be clearer and more future-proof to refer to their constant name. ACKs for top commit: instagibbs: ACK ffc674595cb19b2fdc5705b355bdd3e7f724b860 sipa: ACK ffc674595cb19b2fdc5705b355bdd3e7f724b860 achow101: ACK ffc674595cb19b2fdc5705b355bdd3e7f724b860 glozow: ACK ffc674595cb19b2fdc5705b355bdd3e7f724b860, agree it's clearer for these comments to refer to the greppable name of the limit rather than the number Tree-SHA512: 462afc1c64543877ac58cb3acdb01d42c6d08abfb362802f29f3482d75401a2a8adadbc2facd222a9a9fefcaab6854865ea400f50ad60bec17831d29f7798afe
-rw-r--r--src/net_processing.cpp2
-rw-r--r--src/outputtype.cpp2
-rw-r--r--src/policy/policy.cpp2
-rwxr-xr-xtest/functional/p2p_segwit.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 34f108f901..9b5983b9d0 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -5197,7 +5197,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
std::vector<unsigned char> vData;
vRecv >> vData;
- // Nodes must NEVER send a data item > 520 bytes (the max size for a script data object,
+ // Nodes must NEVER send a data item > MAX_SCRIPT_ELEMENT_SIZE bytes (the max size for a script data object,
// and thus, the maximum size any matched object can have) in a filteradd message
bool bad = false;
if (vData.size() > MAX_SCRIPT_ELEMENT_SIZE) {
diff --git a/src/outputtype.cpp b/src/outputtype.cpp
index 566e5ec55a..c72d9deacb 100644
--- a/src/outputtype.cpp
+++ b/src/outputtype.cpp
@@ -85,7 +85,7 @@ CTxDestination AddAndGetDestinationForScript(FillableSigningProvider& keystore,
{
// Add script to keystore
keystore.AddCScript(script);
- // Note that scripts over 520 bytes are not yet supported.
+ // Note that scripts over MAX_SCRIPT_ELEMENT_SIZE bytes are not yet supported.
switch (type) {
case OutputType::LEGACY:
return ScriptHash(script);
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
index d08ec4fb7f..d8b4b907e4 100644
--- a/src/policy/policy.cpp
+++ b/src/policy/policy.cpp
@@ -111,7 +111,7 @@ bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& max_dat
for (const CTxIn& txin : tx.vin)
{
// Biggest 'standard' txin involving only keys is a 15-of-15 P2SH
- // multisig with compressed keys (remember the 520 byte limit on
+ // multisig with compressed keys (remember the MAX_SCRIPT_ELEMENT_SIZE byte limit on
// redeemScript size). That works out to a (15*(33+1))+3=513 byte
// redeemScript, 513+1+15*(73+1)+3=1627 bytes of scriptSig, which
// we round off to 1650(MAX_STANDARD_SCRIPTSIG_SIZE) bytes for
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py
index 213c748eda..45bbd7f1c3 100755
--- a/test/functional/p2p_segwit.py
+++ b/test/functional/p2p_segwit.py
@@ -1054,7 +1054,7 @@ class SegWitTest(BitcoinTestFramework):
@subtest
def test_max_witness_push_length(self):
- """Test that witness stack can only allow up to 520 byte pushes."""
+ """Test that witness stack can only allow up to MAX_SCRIPT_ELEMENT_SIZE byte pushes."""
block = self.build_next_block()