Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix crash when mining with empty keypool. #6567
Since the introduction of the ScriptForMining callback, the mining functions (setgenerate and generate) crash with an assertion failure (due to a NULL pointer script returned) if the keypool is empty. Fix this by giving a proper error.
I agree in principle (that's why the message/error is keypool specific only in the RPC code and not
Of course, if in the future more conditions can cause a missing script to be returned, one also needs to add a method to signal the error to the caller with more details.