From 493c8bdf806641ed760549f44a6a78f729de4def Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Thu, 26 Sep 2024 10:34:33 +1200 Subject: [PATCH] script: clarify that weight calculation includes the field prefix --- src/script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script.c b/src/script.c index e9359729f..8811942ea 100644 --- a/src/script.c +++ b/src/script.c @@ -227,11 +227,11 @@ static size_t get_commitment_len(const unsigned char *bytes, if (*bytes == WALLY_TX_ASSET_CT_EXPLICIT_PREFIX) { /* Explicit value (unblinded) */ if (prefixA == WALLY_TX_ASSET_CT_VALUE_PREFIX_A) - return WALLY_TX_ASSET_CT_VALUE_UNBLIND_LEN; /* uint64 value */ - return WALLY_TX_ASSET_CT_LEN; /* 32 byte asset tag, or nonce */ + return WALLY_TX_ASSET_CT_VALUE_UNBLIND_LEN; /* prefix + uint64 value */ + return WALLY_TX_ASSET_CT_LEN; /* prefix + 32 byte asset tag or nonce */ } if (*bytes == prefixA || *bytes == prefixB) - return WALLY_TX_ASSET_CT_LEN; /* 32 byte commitment */ + return WALLY_TX_ASSET_CT_LEN; /* prefix + 32 byte commitment */ return 0; /* Invalid serialization */ }