Skip to content

Commit e1d6b66

Browse files
authored
Merge pull request ElementsProject#1346 from delta1/ct-fees-discount
discount: fix init doc for acceptdiscountct and override for creatediscountct
2 parents 5a07eec + fdf3d1e commit e1d6b66

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ class CCustomParams : public CRegTestParams {
896896
consensus.fedpegScript = StrHexToScriptWithDefault(args.GetArg("-fedpegscript", ""), default_script);
897897
consensus.start_p2wsh_script = args.GetIntArg("-con_start_p2wsh_script", consensus.start_p2wsh_script);
898898
create_discount_ct = args.GetBoolArg("-creatediscountct", false);
899-
accept_discount_ct = args.GetBoolArg("-acceptdiscountct", create_discount_ct);
899+
accept_discount_ct = args.GetBoolArg("-acceptdiscountct", false) || create_discount_ct;
900900

901901
// Calculate pegged Bitcoin asset
902902
std::vector<unsigned char> commit = CommitToArguments(consensus, strNetworkID);
@@ -1129,7 +1129,7 @@ class CLiquidV1Params : public CChainParams {
11291129

11301130
multi_data_permitted = true;
11311131
create_discount_ct = args.GetBoolArg("-creatediscountct", false);
1132-
accept_discount_ct = args.GetBoolArg("-acceptdiscountct", false);
1132+
accept_discount_ct = args.GetBoolArg("-acceptdiscountct", false) || create_discount_ct;
11331133

11341134
parentGenesisBlockHash = uint256S("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
11351135
const bool parent_genesis_is_null = parentGenesisBlockHash == uint256();
@@ -1479,7 +1479,7 @@ class CLiquidV1TestParams : public CLiquidV1Params {
14791479

14801480
multi_data_permitted = args.GetBoolArg("-multi_data_permitted", multi_data_permitted);
14811481
create_discount_ct = args.GetBoolArg("-creatediscountct", create_discount_ct);
1482-
accept_discount_ct = args.GetBoolArg("-acceptdiscountct", accept_discount_ct || create_discount_ct);
1482+
accept_discount_ct = args.GetBoolArg("-acceptdiscountct", accept_discount_ct) || create_discount_ct;
14831483

14841484
if (args.IsArgSet("-parentgenesisblockhash")) {
14851485
parentGenesisBlockHash = uint256S(args.GetArg("-parentgenesisblockhash", ""));

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ void SetupServerArgs(ArgsManager& argsman)
640640
argsman.AddArg("-initialreissuancetokens=<n>", "The amount of reissuance tokens created in the genesis block. (default: 0)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
641641
argsman.AddArg("-ct_bits", strprintf("The default number of hiding bits in a rangeproof. Will be exceeded to cover amounts exceeding the maximum hiding value. (default: %d)", 52), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
642642
argsman.AddArg("-ct_exponent", strprintf("The hiding exponent. (default: %s)", 0), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
643-
argsman.AddArg("-acceptdiscountct", "Accept discounted fees for Confidential Transactions (default: true for liquidv1, false for other chains)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
643+
argsman.AddArg("-acceptdiscountct", "Accept discounted fees for Confidential Transactions (default: false)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
644644
argsman.AddArg("-creatediscountct", "Create Confidential Transactions with discounted fees (default: false). Setting this to true will also set 'acceptdiscountct' to true.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
645645

646646
#if defined(USE_SYSCALL_SANDBOX)

test/functional/feature_discount_ct.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def set_test_params(self):
2626
# node 1 accepts but does not create discounted CTs
2727
args + ["-acceptdiscountct=1", "-creatediscountct=0"],
2828
# node 2 both accepts and creates discounted CTs
29-
args + ["-acceptdiscountct=1", "-creatediscountct=1"],
29+
# check that 'create' overrides 'accept'
30+
args + ["-acceptdiscountct=0", "-creatediscountct=1"],
3031
]
3132

3233
def skip_test_if_missing_module(self):

0 commit comments

Comments
 (0)