From 84a2af37f97c6151128aba87b23426b849b70eec Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 17 Feb 2013 16:49:24 -0800 Subject: [PATCH] Add 'getValidatedSeq'. --- src/cpp/ripple/NetworkOPs.cpp | 9 +++++++-- src/cpp/ripple/NetworkOPs.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 6793aa2483..4c798660bf 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -119,6 +119,11 @@ bool NetworkOPs::haveLedger(uint32 seq) return mLedgerMaster->haveLedger(seq); } +uint32 NetworkOPs::getValidatedSeq() +{ + return mLedgerMaster->getValidatedLedger()->getLedgerSeq(); +} + bool NetworkOPs::isValidated(uint32 seq, const uint256& hash) { if (!isValidated(seq)) @@ -1060,7 +1065,7 @@ void NetworkOPs::setMode(OperatingMode om) std::vector< std::pair > NetworkOPs::getAccountTxs(const RippleAddress& account, uint32 minLedger, uint32 maxLedger) -{ +{ // can be called with no locks std::vector< std::pair > ret; std::string sql = @@ -1087,7 +1092,7 @@ std::vector< std::pair > }else rawMeta.resize(metaSize); TransactionMetaSet::pointer meta= boost::make_shared(txn->getID(), txn->getLedger(), rawMeta.getData()); - ret.push_back(std::pair(txn,meta)); + ret.push_back(std::pair(txn,meta)); } } diff --git a/src/cpp/ripple/NetworkOPs.h b/src/cpp/ripple/NetworkOPs.h index a24bee77b6..8940d55cb8 100644 --- a/src/cpp/ripple/NetworkOPs.h +++ b/src/cpp/ripple/NetworkOPs.h @@ -156,6 +156,7 @@ public: // Do we have this inclusive range of ledgers in our database bool haveLedgerRange(uint32 from, uint32 to); bool haveLedger(uint32 seq); + uint32 getValidatedSeq(); bool isValidated(uint32 seq); bool isValidated(uint32 seq, const uint256& hash); bool isValidated(Ledger::ref l) { return isValidated(l->getLedgerSeq(), l->getHash()); }