Why Nostr? What is Njump?
2023-06-07 02:05:03
in reply to

Andy Parkins [ARCHIVE] on Nostr: šŸ“… Original date posted:2011-07-13 šŸ—’ļø Summary of this message: Dr. Andy ...

šŸ“… Original date posted:2011-07-13
šŸ—’ļø Summary of this message: Dr. Andy Parkins is working on a similar project to BitCoinJ's NetworkParameters abstraction, which groups together constants used in the official client.
šŸ“ Original message: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 incomplete)
the following for these magic-constants that are often literals in the offical
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<unsigned int, TBitcoinHash> Checkpoints;

static const TBitcoinHash NULL_REFERENCE_HASH;
static const unsigned int NULL_REFERENCE_INDEX;

Any suggestions for others gratefully received.


Andy

--
Dr Andy Parkins
andyparkins at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20110713/ae0f506a/attachment.sig>;
Author Public Key
npub1nxlvf9mj3jzgue25n5d9y47s3h5hvg0ded9hwpejdxj9mtrs34vs97wjrv