std::vector<uint256> SerializedLedgerEntry::getOwners () { std::vector<uint256> owners; uint160 account; for (int i = 0, fields = getCount (); i < fields; ++i) { SField::ref fc = getFieldSType (i); if ((fc == sfAccount) || (fc == sfOwner)) { const STAccount* entry = dynamic_cast<const STAccount*> (peekAtPIndex (i)); if ((entry != nullptr) && entry->getValueH160 (account)) owners.push_back (Ledger::getAccountRootIndex (account)); } if ((fc == sfLowLimit) || (fc == sfHighLimit)) { const STAmount* entry = dynamic_cast<const STAmount*> (peekAtPIndex (i)); if ((entry != nullptr)) { uint160 issuer = entry->getIssuer (); if (issuer.isNonZero ()) owners.push_back (Ledger::getAccountRootIndex (issuer)); } } } return owners; }
const SerializedType* STObject::peekAtPField (SField::ref field) const { int index = getFieldIndex (field); if (index == -1) return NULL; return peekAtPIndex (index); }
const STBase* STObject::peekAtPField (SField const& field) const { int index = getFieldIndex (field); if (index == -1) return nullptr; return peekAtPIndex (index); }