Fix the crash bug.

This commit is contained in:
JoelKatz
2012-08-01 14:19:13 -07:00
parent 1213f34d75
commit a17ca0cd4a
2 changed files with 8 additions and 1 deletions

View File

@@ -208,6 +208,12 @@ void STVector256::add(Serializer& s) const
s.addVL(mValue.empty() ? NULL : mValue[0].begin(), mValue.size() * (256 / 8));
}
bool STVector256::isEquivalent(const SerializedType& t) const
{
const STVector256* v = dynamic_cast<const STVector256*>(&t);
return v && (mValue == v->mValue);
}
//
// STAccount
//

View File

@@ -83,7 +83,7 @@ public:
virtual void add(Serializer& s) const { return; }
virtual bool isEquivalent(const SerializedType& t) const
{ assert(getSType() == STI_NOTPRESENT); return t.getSType() == STI_NOTPRESENT; }
{ std::cerr << getSType() << std::endl; assert(getSType() == STI_NOTPRESENT); return t.getSType() == STI_NOTPRESENT; }
bool operator==(const SerializedType& t) const
{ return (getSType() == t.getSType()) && isEquivalent(t); }
@@ -696,6 +696,7 @@ public:
const std::vector<uint256>& peekValue() const { return mValue; }
std::vector<uint256>& peekValue() { return mValue; }
virtual bool isEquivalent(const SerializedType& t) const;
std::vector<uint256> getValue() const { return mValue; }