MCPcopy Create free account
hub / github.com/ElementsProject/elements / LoadCScript

Method LoadCScript

src/wallet/scriptpubkeyman.cpp:777–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777bool LegacyScriptPubKeyMan::LoadCScript(const CScript& redeemScript)
778{
779 /* A sanity check was added in pull #3843 to avoid adding redeemScripts
780 * that never can be redeemed. However, old wallets may still contain
781 * these. Do not add them to the wallet and warn. */
782 if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE)
783 {
784 std::string strAddr = EncodeDestination(ScriptHash(redeemScript));
785 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);
786 return true;
787 }
788
789 return FillableSigningProvider::AddCScript(redeemScript);
790}
791
792void LegacyScriptPubKeyMan::LoadKeyMetadata(const CKeyID& keyID, const CKeyMetadata& meta)
793{

Callers 1

walletdb.cppFile · 0.80

Calls 3

EncodeDestinationFunction · 0.85
ScriptHashClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected