Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR completely removes the use of the OpenSSL's class BIGNUM, substituting the uses of CBigNum with the class uint256 with extended arithmetic capabilities (arith_uint256). OpenSSL deprecated some BIGNUM functions in version 1.1, making the wallet not being able to compile in systems which use the newer version. This patch fixes the refered issue.
There's an special case where arith_uint256 is not suitable to handle the needed operations, namely when verifying the kernel hash of proof of stake blocks. Due to the value of the transactions in the first blocks being very high (total supply coming from navajocoin's blockchain because of coin swap) the multiply operation can easily overflow leading to errors in the block validation.
For that reason, arith_uint512 is used in CheckStakeKernelHashV2().