Skip to content

Commit 0b4048c

Browse files
committed
datacarrier: deprecate startup arguments for future removal
1 parent 63091b7 commit 0b4048c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/init.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,9 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
630630
argsman.AddArg("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
631631
argsman.AddArg("-acceptstalefeeestimates", strprintf("Read fee estimates even if they are stale (%sdefault: %u) fee estimates are considered stale if they are %s hours old", "regtest only; ", DEFAULT_ACCEPT_STALE_FEE_ESTIMATES, Ticks<std::chrono::hours>(MAX_FILE_AGE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
632632
argsman.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
633-
argsman.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
633+
argsman.AddArg("-datacarrier", strprintf("(DEPRECATED) Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
634634
argsman.AddArg("-datacarriersize",
635-
strprintf("Relay and mine transactions whose data-carrying raw scriptPubKeys in aggregate "
635+
strprintf("(DEPRECATED) Relay and mine transactions whose data-carrying raw scriptPubKeys in aggregate "
636636
"are of this size or less, allowing multiple outputs (default: %u)",
637637
MAX_OP_RETURN_RELAY),
638638
ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
@@ -875,6 +875,10 @@ bool AppInitParameterInteraction(const ArgsManager& args)
875875
InitWarning(_("Option '-checkpoints' is set but checkpoints were removed. This option has no effect."));
876876
}
877877

878+
if (args.IsArgSet("-datacarriersize") || args.IsArgSet("-datacarrier")) {
879+
InitWarning(_("Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version."));
880+
}
881+
878882
// Error if network-specific options (-addnode, -connect, etc) are
879883
// specified in default section of config file, but not overridden
880884
// on the command line or in this chain's section of the config file.

test/functional/mempool_datacarrier.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ def run_test(self):
8989
self.test_null_data_transaction(node=self.nodes[2], data=one_byte, success=True)
9090
self.test_null_data_transaction(node=self.nodes[3], data=one_byte, success=False)
9191

92+
# Clean shutdown boilerplate due to deprecation
93+
self.expected_stderr = [
94+
"", # node 0 has no deprecated options
95+
"Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.",
96+
"Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.",
97+
"Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.",
98+
]
99+
100+
for i in range(self.num_nodes):
101+
self.stop_node(i, expected_stderr=self.expected_stderr[i])
102+
92103

93104
if __name__ == '__main__':
94105
DataCarrierTest(__file__).main()

0 commit comments

Comments
 (0)