diff --git a/src/TransactionEngine.cpp b/src/TransactionEngine.cpp index efe56ac8c5..1bbe02063e 100644 --- a/src/TransactionEngine.cpp +++ b/src/TransactionEngine.cpp @@ -1,13 +1,19 @@ + #include "TransactionEngine.h" +#include + +#include "../json/writer.h" + #include "Config.h" #include "TransactionFormats.h" #include "utils.h" - -#include +#include "Log.h" typedef SerializedLedgerEntry SLE; + + #define DIR_NODE_MAX 32 // We return the uNodeDir so that on delete we can quickly know where the element is mentioned in the directory. @@ -229,6 +235,24 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran { std::cerr << "applyTransaction>" << std::endl; +#ifdef DEBUG + if (0) + { + Serializer ser; + txn.add(ser); + SerializerIterator sit(ser); + SerializedTransaction s2(sit, -1); + if (!s2.isEquivalent(txn)) + { + std::cerr << "Transaction serdes mismatch" << std::endl; + Json::StyledStreamWriter ssw; + ssw.write(Log(lsINFO).ref(), txn.getJson(0)); + ssw.write(Log(lsFATAL).ref(), s2.getJson(0)); + assert(false); + } + } +#endif + TransactionEngineResult result = terSUCCESS; uint256 txID = txn.getTransactionID();