Refactor Serializer, SerialIter, SHAMapItem, NodeObject:

* Make LessThan private
* Make NodeObject::isSame private
* Remove hotTRANSACTION
* Remove some Serializer members
* Remove unused SHAMapItem::getRaw
* Remove unused STLedgerEntry::getOwners
* Remove Serializer constructors
* Remove unused Serializer members
* Remove SerialIter ctor
This commit is contained in:
Vinnie Falco
2015-05-22 13:10:47 -07:00
parent c25184cc88
commit 8be4e7e65f
56 changed files with 220 additions and 370 deletions

View File

@@ -40,8 +40,7 @@ STLedgerEntry::STLedgerEntry (
const Serializer& s, uint256 const& index)
: STObject (sfLedgerEntry), mIndex (index), mMutable (true)
{
// we know 's' isn't going away
SerialIter sit (const_cast<Serializer&> (s));
SerialIter sit (s.slice());
set (sit);
setSLEType ();
}
@@ -184,38 +183,4 @@ RippleAddress STLedgerEntry::getSecondOwner ()
return RippleAddress::createAccountID (getFieldAmount (sfHighLimit).getIssuer ());
}
std::vector<uint256> STLedgerEntry::getOwners ()
{
std::vector<uint256> owners;
Account account;
for (int i = 0, fields = getCount (); i < fields; ++i)
{
auto const& fc = getFieldSType (i);
if ((fc == sfAccount) || (fc == sfOwner))
{
auto entry = dynamic_cast<const STAccount*> (peekAtPIndex (i));
if ((entry != nullptr) && entry->getValueH160 (account))
owners.push_back (getAccountRootIndex (account));
}
if ((fc == sfLowLimit) || (fc == sfHighLimit))
{
auto entry = dynamic_cast<const STAmount*> (peekAtPIndex (i));
if ((entry != nullptr))
{
auto issuer = entry->getIssuer ();
if (issuer.isNonZero ())
owners.push_back (getAccountRootIndex (issuer));
}
}
}
return owners;
}
} // ripple