Merge branch 'master' of github.com:jedmccaleb/NewCoin

This commit is contained in:
Arthur Britto
2013-01-06 17:50:50 -08:00
5 changed files with 12 additions and 5 deletions

View File

@@ -11,7 +11,7 @@
#include "HashPrefixes.h"
SETUP_LOG();
DECLARE_INSTANCE(PeerSet);
DECLARE_INSTANCE(LedgerAcquire);
#define LA_DEBUG
#define LEDGER_ACQUIRE_TIMEOUT 750

View File

@@ -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<PeerSet>, const boost::system::error_code& result);
};
class LedgerAcquire : public PeerSet, public boost::enable_shared_from_this<LedgerAcquire>
class LedgerAcquire :
private IS_INSTANCE(LedgerAcquire), public PeerSet, public boost::enable_shared_from_this<LedgerAcquire>
{ // A ledger we are trying to acquire
public:
typedef boost::shared_ptr<LedgerAcquire> pointer;

View File

@@ -25,6 +25,7 @@ typedef std::map<uint256, LCTransaction::pointer>::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)
{

View File

@@ -21,8 +21,10 @@
#include "LoadMonitor.h"
DEFINE_INSTANCE(LedgerConsensus);
DEFINE_INSTANCE(TransactionAcquire);
class TransactionAcquire : public PeerSet, public boost::enable_shared_from_this<TransactionAcquire>
class TransactionAcquire :
private IS_INSTANCE(TransactionAcquire), public PeerSet, public boost::enable_shared_from_this<TransactionAcquire>
{ // A transaction set we are trying to acquire
public:
typedef boost::shared_ptr<TransactionAcquire> pointer;

View File

@@ -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;