Maybe the difficulty became so high that generatetoaddress exceeded the maximum iterations?
Oh I see, if I generate 2016 blocks at once it makes difficulty too high, because of this:
difficulty = expected time / actual time
Since expected time is 20160 minutes then the equation would be that:
difficulty = 20160 / actual time
I generated 2016 blocks within 5-10 seconds so that makes difficulty ~= 2000, which is too big for just one computer.
On what script is that
maxtries located?
A few possibilities on what's causing this:
- Maybe it's not accepting the proof of work for any of the blocks your making and
generateBlocks() returns an empty list.
- Or perhaps you exceeded the nonce, so that all block hashes are invalid so no blocks get added to generatetoaddress.
Why it may not accept the proof of work? Even if difficulty was too high, I would not get an empty list. The computer would just try to find a tiny target, which would fail. But it would lag the whole computer, it wouldn't return me an empty list.
Isn't the nonce just an integer? I don't get why is this relevant with my issue.