Use strHex in place of custom function.

This commit is contained in:
Arthur Britto
2012-05-11 14:58:34 -07:00
parent 26fd9f3e43
commit fbd9e60e33

View File

@@ -5,6 +5,7 @@
#include "SerializedObject.h"
#include "TransactionFormats.h"
#include "NewcoinAddress.h"
#include "utils.h"
std::string SerializedType::getFullText() const
{
@@ -133,15 +134,6 @@ bool STHash256::isEquivalent(const SerializedType& t) const
return v && (value == v->value);
}
static std::string hex(const std::vector<unsigned char>& value)
{
int dlen=value.size(), i=0;
char psz[dlen*2 + 1];
for(std::vector<unsigned char>::const_iterator it=value.begin(), end=value.end(); it!=end; ++it)
sprintf(psz + 2*(i++), "%02X", *it);
return std::string(psz, psz + value.size()*2);
}
STVariableLength::STVariableLength(SerializerIterator& st, const char *name) : SerializedType(name)
{
value = st.getVL();
@@ -149,7 +141,7 @@ STVariableLength::STVariableLength(SerializerIterator& st, const char *name) : S
std::string STVariableLength::getText() const
{
return hex(value);
return strHex(value);
}
STVariableLength* STVariableLength::construct(SerializerIterator& u, const char *name)
@@ -230,7 +222,7 @@ std::string STTaggedList::getText() const
{
ret += boost::lexical_cast<std::string>(it->first);
ret += ",";
ret += hex(it->second);
ret += strHex(it->second);
}
return ret;
}