From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qgz6z-00039b-8j for bitcoin-development@lists.sourceforge.net; Wed, 13 Jul 2011 13:04:21 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.175 as permitted sender) client-ip=74.125.82.175; envelope-from=andyparkins@gmail.com; helo=mail-wy0-f175.google.com; Received: from mail-wy0-f175.google.com ([74.125.82.175]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Qgz6w-0006UA-Ue for bitcoin-development@lists.sourceforge.net; Wed, 13 Jul 2011 13:04:21 +0000 Received: by wyg30 with SMTP id 30so137588wyg.34 for ; Wed, 13 Jul 2011 06:04:12 -0700 (PDT) Received: by 10.216.139.37 with SMTP id b37mr5368795wej.41.1310562252749; Wed, 13 Jul 2011 06:04:12 -0700 (PDT) Received: from dvr.localnet (mail.360visiontechnology.com [92.42.121.178]) by mx.google.com with ESMTPS id gb1sm11660198wbb.20.2011.07.13.06.04.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 06:04:11 -0700 (PDT) From: Andy Parkins To: bitcoin-development@lists.sourceforge.net Date: Wed, 13 Jul 2011 14:04:09 +0100 User-Agent: KMail/1.13.6 (Linux/2.6.38-2-686; KDE/4.6.3; i686; ; ) References: <602127524.20110712224712@web.de> <1310516279.2279.20.camel@Desktop666> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2298228.18AGH4ONEy"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201107131404.09788.andyparkins@gmail.com> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (andyparkins[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL To: misformatted and free email service -0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Qgz6w-0006UA-Ue Subject: Re: [Bitcoin-development] overall bitcoin client code quality X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 13:04:21 -0000 --nextPart2298228.18AGH4ONEy Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2011 July 13 Wednesday, Mike Hearn wrote: > For what it's worth, BitCoinJ has a NetworkParameters abstraction that > does what you suggest (groups all the constants together): "all" is a strong word :-) I'm doing a similar thing, and so far I have (and it's definitely incomplet= e)=20 the following for these magic-constants that are often literals in the offi= cal=20 client: TBlock *GenesisBlock; TBitcoinHash ProofOfWorkLimit; uint16_t DefaultTCPPort; uint32_t Magic; uint8_t BitcoinAddressPrefix; unsigned int COINBASE_MATURITY; unsigned int COINBASE_MINIMUM_SCRIPT_SIZE; unsigned int COINBASE_MAXIMUM_SCRIPT_SIZE; unsigned int MAX_BLOCK_SIZE; unsigned int MAX_BLOCK_SIZE_GEN; unsigned int MAX_BLOCK_SIGOPS; unsigned int MINIMUM_TRANSACTION_SIZE; TCoinsElement MIN_MONEY; TCoinsElement MAX_MONEY; TCoinsElement MIN_TX_FEE; TCoinsElement INITIAL_MINING_REWARD; unsigned int INFLATION_PERIOD; unsigned int BLOCK_TIMESTAMP_WINDOW; unsigned int DIFFICULTY_TIMESPAN; unsigned int NEW_BLOCK_PERIOD; unsigned int INV_MAX; unsigned int GETDATA_MAX; unsigned int GETBLOCKS_RESPONSES_MAX; unsigned int GETHEADERS_RESPONSES_MAX; unsigned int ADDR_MAX; unsigned int ADDR_MIN_TIME; unsigned int ADDR_MAX_TIME_OFFSET; unsigned int ADDR_DEFAULT_TIME_PENALTY; unsigned int ASSUME_OFFLINE_AFTER; unsigned int OFFLINE_UPDATE_INTERVAL; unsigned int ONLINE_UPDATE_INTERVAL; map Checkpoints; static const TBitcoinHash NULL_REFERENCE_HASH; static const unsigned int NULL_REFERENCE_INDEX; Any suggestions for others gratefully received. Andy =2D-=20 Dr Andy Parkins andyparkins@gmail.com --nextPart2298228.18AGH4ONEy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEABECAAYFAk4dl8kACgkQwQJ9gE9xL20iMQCfYEGrNds1W15zFf/VAVs++KBe BMMAn2o5iavNrWELiLzNw6o+0mu+Q5VA =VK7H -----END PGP SIGNATURE----- --nextPart2298228.18AGH4ONEy--