Skip to content

Commit 493c8bd

Browse files
committed
script: clarify that weight calculation includes the field prefix
1 parent 1103266 commit 493c8bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/script.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ static size_t get_commitment_len(const unsigned char *bytes,
227227
if (*bytes == WALLY_TX_ASSET_CT_EXPLICIT_PREFIX) {
228228
/* Explicit value (unblinded) */
229229
if (prefixA == WALLY_TX_ASSET_CT_VALUE_PREFIX_A)
230-
return WALLY_TX_ASSET_CT_VALUE_UNBLIND_LEN; /* uint64 value */
231-
return WALLY_TX_ASSET_CT_LEN; /* 32 byte asset tag, or nonce */
230+
return WALLY_TX_ASSET_CT_VALUE_UNBLIND_LEN; /* prefix + uint64 value */
231+
return WALLY_TX_ASSET_CT_LEN; /* prefix + 32 byte asset tag or nonce */
232232
}
233233
if (*bytes == prefixA || *bytes == prefixB)
234-
return WALLY_TX_ASSET_CT_LEN; /* 32 byte commitment */
234+
return WALLY_TX_ASSET_CT_LEN; /* prefix + 32 byte commitment */
235235
return 0; /* Invalid serialization */
236236
}
237237

0 commit comments

Comments
 (0)