Reintroduce BLSInit to correctly set secure alloctor callbacks (#2543)
https://github.com/dashpay/dash/pull/2409 removed the need to call the Init method of the Chia BLS library, but we also accidently removed the initialization of the secure allocator.
This commit is contained in:
parent
d9b28fe1ad
commit
63b58b1e92
@ -19,6 +19,7 @@ main(int argc, char** argv)
|
||||
ECC_Start();
|
||||
ECCVerifyHandle verifyHandle;
|
||||
|
||||
BLSInit();
|
||||
SetupEnvironment();
|
||||
fPrintToDebugLog = false; // don't want to write to debug.log file
|
||||
|
||||
|
@ -462,3 +462,11 @@ static void secure_free(void* p)
|
||||
return get_secure_allocator().deallocate(ptr, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool BLSInit()
|
||||
{
|
||||
#ifndef BUILD_BITCOIN_INTERNAL
|
||||
bls::BLS::SetSecureAllocator(secure_allocate, secure_free);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
@ -300,4 +300,6 @@ typedef std::shared_ptr<BLSPublicKeyVector> BLSPublicKeyVectorPtr;
|
||||
typedef std::shared_ptr<BLSSecretKeyVector> BLSSecretKeyVectorPtr;
|
||||
typedef std::shared_ptr<BLSSignatureVector> BLSSignatureVectorPtr;
|
||||
|
||||
bool BLSInit();
|
||||
|
||||
#endif // DASH_CRYPTO_BLS_H
|
||||
|
@ -855,6 +855,10 @@ bool InitSanityCheck(void)
|
||||
if (!glibc_sanity_test() || !glibcxx_sanity_test())
|
||||
return false;
|
||||
|
||||
if (!BLSInit()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ extern void noui_connect();
|
||||
BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
|
||||
{
|
||||
ECC_Start();
|
||||
BLSInit();
|
||||
SetupEnvironment();
|
||||
SetupNetworking();
|
||||
InitSignatureCache();
|
||||
|
Loading…
Reference in New Issue
Block a user