Skip to content

Commit 6fccad7

Browse files
committed
signet: do not log signet startup messages for other chains
and move signet network magic logging from chainparams.cpp to init.cpp
1 parent 3487e42 commit 6fccad7

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/chainparams.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ class SigNetParams : public CChainParams {
265265
vSeeds.clear();
266266

267267
if (!args.IsArgSet("-signetchallenge")) {
268-
LogPrintf("Using default signet network\n");
269268
bin = ParseHex("512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae");
270269
vSeeds.emplace_back("178.128.221.177");
271270
vSeeds.emplace_back("2a01:7c8:d005:390::5");
@@ -327,7 +326,6 @@ class SigNetParams : public CChainParams {
327326
h << consensus.signet_challenge;
328327
uint256 hash = h.GetHash();
329328
memcpy(pchMessageStart, hash.begin(), 4);
330-
LogPrintf("Signet derived magic (message start): %s\n", HexStr({pchMessageStart, pchMessageStart + 4}));
331329

332330
nDefaultPort = 38333;
333331
nPruneAfterHeight = 1000;

src/init.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <policy/fees.h>
3838
#include <policy/policy.h>
3939
#include <policy/settings.h>
40+
#include <protocol.h>
4041
#include <rpc/blockchain.h>
4142
#include <rpc/register.h>
4243
#include <rpc/server.h>
@@ -966,6 +967,9 @@ bool AppInitParameterInteraction(const ArgsManager& args)
966967
// specified in default section of config file, but not overridden
967968
// on the command line or in this network's section of the config file.
968969
std::string network = args.GetChainName();
970+
if (network == CBaseChainParams::SIGNET) {
971+
LogPrintf("Signet derived magic (message start): %s\n", HexStr(chainparams.MessageStart()));
972+
}
969973
bilingual_str errors;
970974
for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) {
971975
errors += strprintf(_("Config setting for %s only applied on %s network when in [%s] section.") + Untranslated("\n"), arg, network, network);

test/functional/feature_signet.py

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def run_test(self):
6565

6666
assert_equal(self.nodes[4].submitblock(signet_blocks[0]), 'bad-signet-blksig')
6767

68+
self.log.info("test that signet logs the network magic on node start")
69+
with self.nodes[0].assert_debug_log(["Signet derived magic (message start)"]):
70+
self.restart_node(0)
71+
6872

6973
if __name__ == '__main__':
7074
SignetBasicTest().main()

0 commit comments

Comments
 (0)