Add the limit amount issuer to the list of affected accounts.

This commit is contained in:
JoelKatz
2012-12-03 18:08:07 -08:00
parent 93138bb102
commit 25de434252

View File

@@ -79,7 +79,7 @@ std::string SerializedTransaction::getText() const
} }
std::vector<RippleAddress> SerializedTransaction::getAffectedAccounts() const std::vector<RippleAddress> SerializedTransaction::getAffectedAccounts() const
{ { // FIXME: This needs to be thought out better
std::vector<RippleAddress> accounts; std::vector<RippleAddress> accounts;
BOOST_FOREACH(const SerializedType& it, peekData()) BOOST_FOREACH(const SerializedType& it, peekData())
@@ -100,6 +100,26 @@ std::vector<RippleAddress> SerializedTransaction::getAffectedAccounts() const
if (!found) if (!found)
accounts.push_back(na); accounts.push_back(na);
} }
if (it.getFName() == sfLimitAmount)
{
uint160 issuer = dynamic_cast<const STAmount*>(&it)->getIssuer();
if (issuer.isNonZero())
{
RippleAddress na;
na.setAccountID(issuer);
bool found = false;
BOOST_FOREACH(const RippleAddress& it, accounts)
{
if (it == na)
{
found = true;
break;
}
}
if (!found)
accounts.push_back(na);
}
}
} }
return accounts; return accounts;
} }