diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 7b9a78bb0..d37b12442 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -1236,6 +1236,15 @@ NetworkOPs::getAccountTxs (const RippleAddress& account, int32 minLedger, int32 ledger->pendSave(false); } + if (rawMeta.getLength() == 0) + { // Work around a bug that could leave the metadata missing + uint32 seq = static_cast(db->getBigInt("AccountTransactions.LedgerSeq")); + WriteLog(lsWARNING, NetworkOPs) << "Recovering ledger " << seq << ", txn " << txn->getID(); + Ledger::pointer ledger = getLedgerBySeq(seq); + if (ledger) + ledger->pendSave(false); + } + TransactionMetaSet::pointer meta = boost::make_shared (txn->getID (), txn->getLedger (), rawMeta.getData ()); ret.push_back (std::pair (txn, meta)); }