From 0e4b31755534fac4ea6c20a60f719e3694252220 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Tue, 7 May 2013 15:16:25 +0200 Subject: Introduce a CChainParameters singleton class and regtest mode. The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet. --- src/protocol.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index 4998425070..ae541dfdba 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -10,20 +10,12 @@ #ifndef __INCLUDED_PROTOCOL_H__ #define __INCLUDED_PROTOCOL_H__ +#include "chainparams.h" #include "serialize.h" #include "netbase.h" #include #include "uint256.h" -extern bool fTestNet; -static inline unsigned short GetDefaultPort(const bool testnet = fTestNet) -{ - return testnet ? 18333 : 8333; -} - - -extern unsigned char pchMessageStart[4]; - /** Message header. * (4) message start. * (12) command. @@ -50,7 +42,6 @@ class CMessageHeader // TODO: make private (improves encapsulation) public: enum { - MESSAGE_START_SIZE=sizeof(::pchMessageStart), COMMAND_SIZE=12, MESSAGE_SIZE_SIZE=sizeof(int), CHECKSUM_SIZE=sizeof(int), -- cgit v1.2.3