Skip to content

Commit

Permalink
script: clarify that weight calculation includes the field prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jgriffiths committed Sep 25, 2024
1 parent 1103266 commit 493c8bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}

Expand Down

0 comments on commit 493c8bd

Please sign in to comment.