MCPcopy Create free account
hub / github.com/LUX-Core/lux / LoadCScript

Method LoadCScript

src/wallet.cpp:394–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392bool fWalletUnlockStakingOnly = false;
393
394bool CWallet::LoadCScript(const CScript& redeemScript)
395{
396 /* A sanity check was added in pull #3843 to avoid adding redeemScripts
397 * that never can be redeemed. However, old wallets may still contain
398 * these. Do not add them to the wallet and warn. */
399 if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) {
400 std::string strAddr = EncodeDestination(CScriptID(redeemScript));
401 LogPrintf("%s: Warning: This wallet contains a redeemScript of size %i which exceeds maximum size %i thus can never be redeemed. Do not use address %s.\n",
402 __func__, redeemScript.size(), MAX_SCRIPT_ELEMENT_SIZE, strAddr);
403 return true;
404 }
405
406 return CCryptoKeyStore::AddCScript(redeemScript);
407}
408
409bool CWallet::AddWatchOnly(const CScript& dest)
410{

Callers 1

ReadKeyValueFunction · 0.80

Calls 3

EncodeDestinationFunction · 0.85
CScriptIDClass · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected