| 360 | } |
| 361 | |
| 362 | bool 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 | |
| 377 | bool CWallet::AddWatchOnly(const CScript& dest) |
| 378 | { |
no test coverage detected