From ddcebec5a5879292998ef647b799a28057a2fdcb Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 8 May 2013 15:28:52 -0700 Subject: [PATCH] Add 'ripple line to self' to list of internal errors we check metadata for. --- src/cpp/ripple/TransactionCheck.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cpp/ripple/TransactionCheck.cpp b/src/cpp/ripple/TransactionCheck.cpp index 9e43553207..2d4a0f8ea4 100644 --- a/src/cpp/ripple/TransactionCheck.cpp +++ b/src/cpp/ripple/TransactionCheck.cpp @@ -56,6 +56,16 @@ bool TransactionEngine::checkInvariants(TER result, const SerializedTransaction& } 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 xrpChange += entry.mEntry->getFieldAmount(sfBalance).getSNValue(); }