3
I was trying to run my own private bitcoin network, so I downloaded the source and compiled it, then I started two bitcoind instances in two docker contains, and I made sure they did not connect to outside network, used -connect=0 -dns=0 -dnsseed=0, and then -addnode to specify other node's ip and port. When I then tried to run a local miner, the RPC getblocktemplate always return Bitcoin is downloading blocks.... By looking at the source, it looks it won't pass this line:
// in IsInitialBlockDownlaod
if (chainActive.Tip()->nChainWork < nMinimumChainWork) {
return true;
}
the definition is found in chainparams.cpp:
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000f91c579d57cad4bc5278cc");
What does this mean? What is nMinimumChainWork for? And what is the hardcoded hex number, by searching blockchain.info it is not a block hash.
Ok, so the number is from an actual bitcoin network's block, that means the software is hard wired to the mainnet, no way to run one's own private network, is that right? – fluter – 2018-03-09T13:41:10.687
No, its just like an amount of work that is needed, any chain that had that much work would be accepted. BUT it would be basically impossible to create a new chain with that much work, that's the point of PoW, so you're correct that you would need to modify that value if you want to run your own private network (you would be creating an altcoin) – MeshCollider – 2018-03-09T18:06:11.753