Allow Rust-language related assets to be disabled with --disable-rust.

This commit is contained in:
Sean Bowe
2017-03-18 06:47:24 -06:00
parent 6a0c7ceae9
commit 802ea76b3a
5 changed files with 47 additions and 8 deletions

View File

@@ -5,8 +5,6 @@
#include "pow.h"
#include "librustzcash.h"
#include "arith_uint256.h"
#include "chain.h"
#include "chainparams.h"
@@ -18,6 +16,10 @@
#include "sodium.h"
#ifdef ENABLE_RUST
#include "librustzcash.h"
#endif // ENABLE_RUST
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
{
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
@@ -98,11 +100,13 @@ bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams& param
// H(I||V||...
crypto_generichash_blake2b_update(&state, (unsigned char*)&ss[0], ss.size());
#ifdef ENABLE_RUST
// Ensure that our Rust interactions are working in production builds. This is
// temporary and should be removed.
{
assert(librustzcash_xor(0x0f0f0f0f0f0f0f0f, 0x1111111111111111) == 0x1e1e1e1e1e1e1e1e);
}
#endif // ENABLE_RUST
bool isValid;
EhIsValidSolution(n, k, state, pblock->nSolution, isValid);