Rise difficulty in code, still no changes after rebuild I'm playing around with the code and tried to adjust difficulty by changing code from 


  bnProofOfWorkLimit = ~uint256(0) >> 1


to 

bnProofOfWorkLimit = ~uint256(0) &gt;&gt; 20


inside code block for Regression Test in chainparams.cpp (bitcoin-0.10.0).

I configured, did make, then make install with binaries in a custom directory (not default /usr/local/bin/bitcoind !), started bitcoind in regtest mode and generated some blocks. 
Somehow it feels like it takes same amount of time for generating blocks as before modifying the code.

What am I doing wrong?



UPDATE:

Changed difficulty in chainparams.cpp from


  bnProofOfWorkLimit = ~uint256(0) >> 1


to

bnProofOfWorkLimit = ~uint256(0) &gt;&gt; 32


still getting this:

Bitcoin version v0.10.0.0-g047a898 (Fri, 13 Feb 2015 09:55:11 +0100)
Using OpenSSL version OpenSSL 1.0.1f 6 Jan 2014
Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
Default data directory /home/aliakbar/.bitcoin
Using data directory /home/aliakbar/Downloads/bitcoin-0.10.0_test1/build/bin/test1/regtest
Using config file /home/aliakbar/Downloads/bitcoin-0.10.0_test1/build/bin/test1/bitcoin.conf
Using at most 125 connections (1024 file descriptors available)
Using 4 threads for script verification
Binding RPC on address ::1 port 23333 (IPv4+IPv6 bind any: 0)
Binding RPC on address 127.0.0.1 port 23333 (IPv4+IPv6 bind any: 0)
Using wallet wallet.dat
init message: Verifying wallet...
CDBEnv::Open : LogDir=/home/aliakbar/Downloads/bitcoin-0.10.0_test1/build/bin/test1/regtest/database ErrorFile=/home/aliakbar/Downloads/bitcoin-0.10.0_test1/build/bin/test1/regtest/db.log
Bound to [::]:13333
Bound to 0.0.0.0:13333
init message: Loading block index...
Opening LevelDB in /home/aliakbar/Downloads/bitcoin-0.10.0_test1/build/bin/test1/regtest/blocks/index
Opened LevelDB successfully
Opening LevelDB in /home/aliakbar/Downloads/bitcoin-0.10.0_test1/build/bin/test1/regtest/chainstate
Opened LevelDB successfully
LoadBlockIndexDB: last block file = 0
LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
Checking all blk files are present...
LoadBlockIndexDB(): transaction index disabled
Initializing databases...
Pre-allocating up to position 0x1000000 in blk00000.dat
ERROR: CheckProofOfWork() : nBits below minimum work
ERROR: CheckBlockHeader() : proof of work failed
InvalidChainFound: invalid block=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206  height=0  log2_work=1  date=2011-02-02 23:16:42


What am I doing wrong? Do I have to adjust difficulty somewhere else than in chainparams.cpp?
What am I doing wrong?


Not setting the difficulty high enough. A standard computer can do 1 MH/s SHA256d hashes, or about 2^20 hashes. That means in your scenario, solving a regtest block will take about 1 second. If you want it to take longer, increase the difficulty.

Also, note that if you're using an 0.9.* version of bitcoin, then setting the regtest difficulty to below ~uint256(0) &gt;&gt; 16 won't really do much, as the mining code won't even check a result that doesn't hash to below that difficulty.

If you're using the most recent code, though, then rather than adjusting the regtest parameters, you could also just add your own set of parameters.