aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-09-30 19:08:52 +0200
committerJon Atack <jon@atack.com>2020-10-01 11:25:42 +0200
commit6fccad7f711df330e461c1fab3f758d078345ed5 (patch)
treed63d51f64ff9fc2ac59e7b87f92f5160a2cdbffe
parent3487e421a7fef4b28381efcf21a7e38483946cec (diff)
downloadbitcoin-6fccad7f711df330e461c1fab3f758d078345ed5.tar.xz
signet: do not log signet startup messages for other chains
and move signet network magic logging from chainparams.cpp to init.cpp
-rw-r--r--src/chainparams.cpp2
-rw-r--r--src/init.cpp4
-rwxr-xr-xtest/functional/feature_signet.py4
3 files changed, 8 insertions, 2 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index 931c2b5297..ef501e9de2 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -265,7 +265,6 @@ public:
vSeeds.clear();
if (!args.IsArgSet("-signetchallenge")) {
- LogPrintf("Using default signet network\n");
bin = ParseHex("512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae");
vSeeds.emplace_back("178.128.221.177");
vSeeds.emplace_back("2a01:7c8:d005:390::5");
@@ -327,7 +326,6 @@ public:
h << consensus.signet_challenge;
uint256 hash = h.GetHash();
memcpy(pchMessageStart, hash.begin(), 4);
- LogPrintf("Signet derived magic (message start): %s\n", HexStr({pchMessageStart, pchMessageStart + 4}));
nDefaultPort = 38333;
nPruneAfterHeight = 1000;
diff --git a/src/init.cpp b/src/init.cpp
index dea5f097e5..edf2a79998 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -37,6 +37,7 @@
#include <policy/fees.h>
#include <policy/policy.h>
#include <policy/settings.h>
+#include <protocol.h>
#include <rpc/blockchain.h>
#include <rpc/register.h>
#include <rpc/server.h>
@@ -966,6 +967,9 @@ bool AppInitParameterInteraction(const ArgsManager& args)
// specified in default section of config file, but not overridden
// on the command line or in this network's section of the config file.
std::string network = args.GetChainName();
+ if (network == CBaseChainParams::SIGNET) {
+ LogPrintf("Signet derived magic (message start): %s\n", HexStr(chainparams.MessageStart()));
+ }
bilingual_str errors;
for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) {
errors += strprintf(_("Config setting for %s only applied on %s network when in [%s] section.") + Untranslated("\n"), arg, network, network);
diff --git a/test/functional/feature_signet.py b/test/functional/feature_signet.py
index a0e7f3ee6e..96c581dede 100755
--- a/test/functional/feature_signet.py
+++ b/test/functional/feature_signet.py
@@ -65,6 +65,10 @@ class SignetBasicTest(BitcoinTestFramework):
assert_equal(self.nodes[4].submitblock(signet_blocks[0]), 'bad-signet-blksig')
+ self.log.info("test that signet logs the network magic on node start")
+ with self.nodes[0].assert_debug_log(["Signet derived magic (message start)"]):
+ self.restart_node(0)
+
if __name__ == '__main__':
SignetBasicTest().main()