MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / LoadCScript

Method LoadCScript

src/wallet/wallet.cpp:362–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362bool CWallet::LoadCScript(const CScript& redeemScript)
363{
364 /* A sanity check was added in pull #3843 to avoid adding redeemScripts
365 * that never can be redeemed. However, old wallets may still contain
366 * these. Do not add them to the wallet and warn. */
367 if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE)
368 {
369 std::string strAddr = EncodeDestination(CScriptID(redeemScript));
370 WalletLogPrintf("%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", __func__, redeemScript.size(), MAX_SCRIPT_ELEMENT_SIZE, strAddr);
371 return true;
372 }
373
374 return CCryptoKeyStore::AddCScript(redeemScript);
375}
376
377bool CWallet::AddWatchOnly(const CScript& dest)
378{

Callers 1

walletdb.cppFile · 0.80

Calls 3

EncodeDestinationFunction · 0.85
CScriptIDClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected