after i change genesis block in chainparams.cpp, i do mining in regtest mode.
$ bitcoin-cli -datadir=../datadir2/ generate 101
[
]
the return result is empty. However, i can see new blocks created in debug.log
CreateNewBlock(): block weight: 900 txs: 0 fees: 0 sigops 400
2018-08-02 08:15:24 nProofOfWorkLimit = 545259519 before bounds
2018-08-02 08:15:24 nProofOfWorkLimit = 545259519 before bounds
2018-08-02 08:15:24 nProofOfWorkLimit = 545259519 before bounds
i found out the reason , in regtest mode, after changing the genesis block, in bitcoin core mining.cpp, generateBlocks() call CheckProofOfWork(), the parameter passed to the function, includes hash value of block, so in CheckProofOfWork() , the line `if (UintToArith256(hash) > bnTarget)` is fulfilled and returns false, so mining fails.
Why changing of genesis block causing mining to fail in regtest ?