mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user