diff --git a/src/keystore.cpp b/src/keystore.cpp --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -62,10 +62,11 @@ } bool CBasicKeyStore::AddCScript(const CScript &redeemScript) { - if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) + if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) { return error("CBasicKeyStore::AddCScript(): redeemScripts > %i bytes " "are invalid", MAX_SCRIPT_ELEMENT_SIZE); + } LOCK(cs_KeyStore); mapScripts[CScriptID(redeemScript)] = redeemScript; @@ -102,13 +103,17 @@ CScript::const_iterator pc = dest.begin(); opcodetype opcode; std::vector vch; - if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65) + if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65) { return false; + } pubKeyOut = CPubKey(vch); - if (!pubKeyOut.IsFullyValid()) return false; + if (!pubKeyOut.IsFullyValid()) { + return false; + } if (!dest.GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG || - dest.GetOp(pc, opcode, vch)) + dest.GetOp(pc, opcode, vch)) { return false; + } return true; } @@ -116,7 +121,9 @@ LOCK(cs_KeyStore); setWatchOnly.insert(dest); CPubKey pubKey; - if (ExtractPubKey(dest, pubKey)) mapWatchKeys[pubKey.GetID()] = pubKey; + if (ExtractPubKey(dest, pubKey)) { + mapWatchKeys[pubKey.GetID()] = pubKey; + } return true; } @@ -124,7 +131,9 @@ LOCK(cs_KeyStore); setWatchOnly.erase(dest); CPubKey pubKey; - if (ExtractPubKey(dest, pubKey)) mapWatchKeys.erase(pubKey.GetID()); + if (ExtractPubKey(dest, pubKey)) { + mapWatchKeys.erase(pubKey.GetID()); + } return true; }