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

Method LoadCScript

src/wallet/scriptpubkeyman.cpp:288–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288bool LegacyDataSPKM::LoadCScript(const CScript& redeemScript)
289{
290 /* A sanity check was added in pull #3843 to avoid adding redeemScripts
291 * that never can be redeemed. However, old wallets may still contain
292 * these. Do not add them to the wallet and warn. */
293 if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE)
294 {
295 std::string strAddr = EncodeDestination(ScriptHash(redeemScript));
296 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);
297 return true;
298 }
299
300 return FillableSigningProvider::AddCScript(redeemScript);
301}
302
303void LegacyDataSPKM::LoadKeyMetadata(const CKeyID& keyID, const CKeyMetadata& meta)
304{

Callers 1

walletdb.cppFile · 0.80

Calls 3

EncodeDestinationFunction · 0.85
ScriptHashClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected