mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Suppress duplicates.
This commit is contained in:
@@ -85,8 +85,22 @@ std::vector<NewcoinAddress> SerializedTransaction::getAffectedAccounts() const
|
|||||||
end = mInnerTxn.peekData().end(); it != end ; ++it)
|
end = mInnerTxn.peekData().end(); it != end ; ++it)
|
||||||
{
|
{
|
||||||
const STAccount* sa = dynamic_cast<const STAccount*>(&*it);
|
const STAccount* sa = dynamic_cast<const STAccount*>(&*it);
|
||||||
if (sa != NULL) // FIXME: Should we check for duplicates?
|
if (sa != NULL)
|
||||||
accounts.push_back(sa->getValueNCA());
|
{
|
||||||
|
bool found = false;
|
||||||
|
NewcoinAddress na = sa->getValueNCA();
|
||||||
|
for (std::vector<NewcoinAddress>::iterator it = accounts.begin(), end = accounts.end();
|
||||||
|
it != end; ++it)
|
||||||
|
{
|
||||||
|
if (*it == na)
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
accounts.push_back(na);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return accounts;
|
return accounts;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user