Add 'ripple line to self' to list of internal errors we check metadata for.

This commit is contained in:
JoelKatz
2013-05-08 15:28:52 -07:00
parent 04b0f968fd
commit ddcebec5a5

View File

@@ -56,6 +56,16 @@ bool TransactionEngine::checkInvariants(TER result, const SerializedTransaction&
} }
else if (entry.mAction == taaCREATE) else if (entry.mAction == taaCREATE)
{ {
if (entry.mEntry->getType() == ltRIPPLE_STATE)
{
if (entry.mEntry->getFieldAmount(sfLowLimit).getIssuer() ==
entry.mEntry->getFieldAmount(sfHighLimit).getIssuer())
{
cLog(lsFATAL) << "Ripple line to self";
assert(false);
return tefINTERNAL;
}
}
if (entry.mEntry->getType() == ltACCOUNT_ROOT) // account created if (entry.mEntry->getType() == ltACCOUNT_ROOT) // account created
xrpChange += entry.mEntry->getFieldAmount(sfBalance).getSNValue(); xrpChange += entry.mEntry->getFieldAmount(sfBalance).getSNValue();
} }