From db8eb54bd7239ff2b046fe34b1c8d692860c6b5b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 30 Sep 2014 19:45:20 -0400 Subject: script: move ToString and ValueString out of the header --- src/script/script.h | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src/script/script.h') diff --git a/src/script/script.h b/src/script/script.h index 6676e852ae..4f6ee0c521 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -318,13 +318,6 @@ private: int64_t m_value; }; -inline std::string ValueString(const std::vector& vch) -{ - if (vch.size() <= 4) - return strprintf("%d", CScriptNum(vch).getint()); - else - return HexStr(vch); -} /** Serialized script, used inside transaction inputs and outputs */ class CScript : public std::vector @@ -571,28 +564,7 @@ public: return (size() > 0 && *begin() == OP_RETURN); } - std::string ToString() const - { - std::string str; - opcodetype opcode; - std::vector vch; - const_iterator pc = begin(); - while (pc < end()) - { - if (!str.empty()) - str += " "; - if (!GetOp(pc, opcode, vch)) - { - str += "[error]"; - return str; - } - if (0 <= opcode && opcode <= OP_PUSHDATA4) - str += ValueString(vch); - else - str += GetOpName(opcode); - } - return str; - } + std::string ToString() const; void clear() { // The default std::vector::clear() does not release memory. -- cgit v1.2.3