Skip to content

Commit edfa40e

Browse files
committed
Remove the min(max( construction for the ct_exponent argument
We removed the similar construction for ct_bits in an earlier commit. The construction is to keep the value between -1 and 18. This kind of means that a user that inputs a value outside that range will not get an error, but will use the value on the edge of the range instead. It's probably better to return an error (generated by secp256k1) in the case of invalid input.
1 parent 95602ec commit edfa40e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/blind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool GenerateRangeproof(std::vector<unsigned char>& rangeproof, const std::vecto
178178
memcpy(asset_message+32, asset_blindptrs[asset_blindptrs.size()-1], 32);
179179

180180
// Sign rangeproof
181-
int ct_exponent = std::min(std::max((int)gArgs.GetArg("-ct_exponent", 0), -1), 18);
181+
int ct_exponent = (int)gArgs.GetArg("-ct_exponent", 0);
182182
int ct_bits = (int)gArgs.GetArg("-ct_bits", 52);
183183
// If min_value is 0, scriptPubKey must be unspendable
184184
uint64_t min_value = scriptPubKey.IsUnspendable() ? 0 : 1;

0 commit comments

Comments
 (0)