The difficulty is merely a user facing thing. In reality, it does not calculate the difficulty at all and the difficulty itself is never used anywhere.
The only thing that matters when it comes to the proof of work is that the block hash, when interpreted as a 256 bit little endian integer, is less than or equal to the target value.
So you mean that if I change nBits and consensus.powLimit parameters in chainparams.cpp the whole network should work fine ? but I face a problem when I run two bitcoindd :
bitcoind -dns=0 -dnsseed=0 -port=15333 -rpcport=15332 -datadir=/home/.../.bitcoin2
and
bitcoind -dns=0 -dnsseed=0 -port=6333 -rpcport=6332 -addnode=127.0.0.1:15332 -debug=rpc
The two servers start up properly but when i type the command "bicoin-cli getblocktemplate" I get
error code: -10
error message:
Bitcoin is downloading blocks...
The problem is insanely strange to me since when I set those two parameters back to what they have been, The whole thing works fine. Here's my code
http:// [url]https://github.com/chameleon1239/bitcoin.git . Would be really thankful if you take a look at it.