diff --git a/src/cpp/ripple/LedgerAcquire.cpp b/src/cpp/ripple/LedgerAcquire.cpp index 4d3ab2625f..4243fe2fb2 100644 --- a/src/cpp/ripple/LedgerAcquire.cpp +++ b/src/cpp/ripple/LedgerAcquire.cpp @@ -11,7 +11,7 @@ #include "HashPrefixes.h" SETUP_LOG(); -DECLARE_INSTANCE(PeerSet); +DECLARE_INSTANCE(LedgerAcquire); #define LA_DEBUG #define LEDGER_ACQUIRE_TIMEOUT 750 diff --git a/src/cpp/ripple/LedgerAcquire.h b/src/cpp/ripple/LedgerAcquire.h index 569ec02af7..c27e88d388 100644 --- a/src/cpp/ripple/LedgerAcquire.h +++ b/src/cpp/ripple/LedgerAcquire.h @@ -18,9 +18,9 @@ #include "InstanceCounter.h" #include "ripple.pb.h" -DEFINE_INSTANCE(PeerSet); +DEFINE_INSTANCE(LedgerAcquire); -class PeerSet : private IS_INSTANCE(PeerSet) +class PeerSet { protected: uint256 mHash; @@ -67,7 +67,8 @@ private: static void TimerEntry(boost::weak_ptr, const boost::system::error_code& result); }; -class LedgerAcquire : public PeerSet, public boost::enable_shared_from_this +class LedgerAcquire : + private IS_INSTANCE(LedgerAcquire), public PeerSet, public boost::enable_shared_from_this { // A ledger we are trying to acquire public: typedef boost::shared_ptr pointer; diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index f0579b3b60..2c48a0f639 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -25,6 +25,7 @@ typedef std::map::value_type u256_lct_pair; SETUP_LOG(); DECLARE_INSTANCE(LedgerConsensus); +DECLARE_INSTANCE(TransactionAcquire); TransactionAcquire::TransactionAcquire(const uint256& hash) : PeerSet(hash, TX_ACQUIRE_TIMEOUT), mHaveRoot(false) { diff --git a/src/cpp/ripple/LedgerConsensus.h b/src/cpp/ripple/LedgerConsensus.h index 7890d2094b..a80cba3a00 100644 --- a/src/cpp/ripple/LedgerConsensus.h +++ b/src/cpp/ripple/LedgerConsensus.h @@ -21,8 +21,10 @@ #include "LoadMonitor.h" DEFINE_INSTANCE(LedgerConsensus); +DEFINE_INSTANCE(TransactionAcquire); -class TransactionAcquire : public PeerSet, public boost::enable_shared_from_this +class TransactionAcquire : + private IS_INSTANCE(TransactionAcquire), public PeerSet, public boost::enable_shared_from_this { // A transaction set we are trying to acquire public: typedef boost::shared_ptr pointer; diff --git a/src/cpp/ripple/LedgerMaster.cpp b/src/cpp/ripple/LedgerMaster.cpp index c8eafcb4c7..9c3ab337a2 100644 --- a/src/cpp/ripple/LedgerMaster.cpp +++ b/src/cpp/ripple/LedgerMaster.cpp @@ -357,6 +357,9 @@ void LedgerMaster::checkPublish(const uint256& hash, uint32 seq) { // check if we need to publish any held ledgers boost::recursive_mutex::scoped_lock ml(mLock); + // FIXME: This code needs to try much more aggressively to fill holes + // before publishing them. + if (seq <= mLastValidateSeq) return;