diff --git a/src/script/script.h b/src/script/script.h --- a/src/script/script.h +++ b/src/script/script.h @@ -343,10 +343,11 @@ } int getint() const { - if (m_value > std::numeric_limits::max()) + if (m_value > std::numeric_limits::max()) { return std::numeric_limits::max(); - else if (m_value < std::numeric_limits::min()) + } else if (m_value < std::numeric_limits::min()) { return std::numeric_limits::min(); + } return m_value; } @@ -536,11 +537,17 @@ bool GetOp2(const_iterator &pc, opcodetype &opcodeRet, std::vector *pvchRet) const { opcodeRet = OP_INVALIDOPCODE; - if (pvchRet) pvchRet->clear(); - if (pc >= end()) return false; + if (pvchRet) { + pvchRet->clear(); + } + if (pc >= end()) { + return false; + } // Read instruction - if (end() - pc < 1) return false; + if (end() - pc < 1) { + return false; + } uint32_t opcode = *pc++; @@ -550,21 +557,29 @@ if (opcode < OP_PUSHDATA1) { nSize = opcode; } else if (opcode == OP_PUSHDATA1) { - if (end() - pc < 1) return false; + if (end() - pc < 1) { + return false; + } nSize = *pc++; } else if (opcode == OP_PUSHDATA2) { - if (end() - pc < 2) return false; + if (end() - pc < 2) { + return false; + } nSize = ReadLE16(&pc[0]); pc += 2; } else if (opcode == OP_PUSHDATA4) { - if (end() - pc < 4) return false; + if (end() - pc < 4) { + return false; + } nSize = ReadLE32(&pc[0]); pc += 4; } if (end() - pc < 0 || uint32_t(end() - pc) < nSize) { return false; } - if (pvchRet) pvchRet->assign(pc, pc + nSize); + if (pvchRet) { + pvchRet->assign(pc, pc + nSize); + } pc += nSize; }