diff --git a/src/ripple/sslutil/impl/CBigNum.cpp b/src/ripple/sslutil/impl/CBigNum.cpp index ded9cae5df..c36d702066 100644 --- a/src/ripple/sslutil/impl/CBigNum.cpp +++ b/src/ripple/sslutil/impl/CBigNum.cpp @@ -228,7 +228,7 @@ void CBigNum::setuint64 (uint64 n) void CBigNum::setuint256 (uint256 const& n) { - BN_bin2bn (n.begin (), n.size (), NULL); + BN_bin2bn (n.begin (), n.size (), this); } uint256 CBigNum::getuint256 () diff --git a/src/ripple_app/consensus/LedgerConsensus.cpp b/src/ripple_app/consensus/LedgerConsensus.cpp index 7f54d2a811..c3ae5adecf 100644 --- a/src/ripple_app/consensus/LedgerConsensus.cpp +++ b/src/ripple_app/consensus/LedgerConsensus.cpp @@ -606,6 +606,9 @@ public: idleInterval = LEDGER_IDLE_INTERVAL; } + idleInterval = std::max (idleInterval, LEDGER_IDLE_INTERVAL); + idleInterval = std::max (idleInterval, 2 * mPreviousLedger->getCloseResolution ()); + if (ContinuousLedgerTiming::shouldClose (anyTransactions , mPreviousProposers, proposersClosed, proposersValidated , mPreviousMSeconds, sinceClose, mCurrentMSeconds diff --git a/src/ripple_app/data/SqliteDatabase.cpp b/src/ripple_app/data/SqliteDatabase.cpp index 6bc48aafb6..eeb670e739 100644 --- a/src/ripple_app/data/SqliteDatabase.cpp +++ b/src/ripple_app/data/SqliteDatabase.cpp @@ -471,10 +471,10 @@ bool SqliteStatement::isError (int j) case SQLITE_OK: case SQLITE_ROW: case SQLITE_DONE: - return true; + return false; default: - return false; + return true; } } diff --git a/src/ripple_app/ledger/Ledger.cpp b/src/ripple_app/ledger/Ledger.cpp index 1507430541..1633c3a9ca 100644 --- a/src/ripple_app/ledger/Ledger.cpp +++ b/src/ripple_app/ledger/Ledger.cpp @@ -1488,7 +1488,7 @@ uint256 Ledger::getLedgerFeeIndex () uint256 Ledger::getLedgerFeatureIndex () { - // get the index of the node that holds the last 256 ledgers + // get the index of the node that holds the enabled features Serializer s (2); s.add16 (spaceFeature); return s.getSHA512Half (); diff --git a/src/ripple_app/ledger/LedgerMaster.cpp b/src/ripple_app/ledger/LedgerMaster.cpp index 60a01b1d4f..47fc3188fd 100644 --- a/src/ripple_app/ledger/LedgerMaster.cpp +++ b/src/ripple_app/ledger/LedgerMaster.cpp @@ -63,7 +63,6 @@ public: uint32 mLastValidateSeq; std::list mOnValidate; // Called when a ledger has enough validations - std::list mPubLedgers; // List of ledgers to publish bool mAdvanceThread; // Publish thread is running bool mAdvanceWork; // Publish thread has work to do int mFillInProgress; @@ -297,7 +296,7 @@ public: { TransactionEngineParams tepFlags = tapOPEN_LEDGER; - if (getApp().getHashRouter ().addSuppressionPeer (it->first.getTXID (), SF_SIGGOOD)) + if (getApp().getHashRouter ().addSuppressionFlags (it->first.getTXID (), SF_SIGGOOD)) tepFlags = static_cast (tepFlags | tapNO_CHECK_SIGN); bool didApply; diff --git a/src/ripple_basics/containers/TaggedCache.h b/src/ripple_basics/containers/TaggedCache.h index cca4b7d87b..879b576c1f 100644 --- a/src/ripple_basics/containers/TaggedCache.h +++ b/src/ripple_basics/containers/TaggedCache.h @@ -301,13 +301,13 @@ void TaggedCacheType::sweep () ScopedLockType sl (mLock, __FILE__, __LINE__); int const now = Timer::getElapsedSeconds (); - int target = now - mTargetAge; + int target = (now < mTargetAge) ? 0 : (now - mTargetAge); if ((mTargetSize != 0) && (static_cast (mCache.size ()) > mTargetSize)) { target = now - (mTargetAge * mTargetSize / mCache.size ()); - if (target > (now - 2)) + if ((now > 2) && (target > (now - 2))) target = now - 2; WriteLog (lsINFO, TaggedCacheLog) << mName << " is growing fast " << diff --git a/src/ripple_data/crypto/CKey.h b/src/ripple_data/crypto/CKey.h index 20561ccd40..fcc1e01a05 100644 --- a/src/ripple_data/crypto/CKey.h +++ b/src/ripple_data/crypto/CKey.h @@ -92,22 +92,24 @@ public: CKey () { pkey = EC_KEY_new_by_curve_name (NID_secp256k1); - EC_KEY_set_conv_form (pkey, POINT_CONVERSION_COMPRESSED); if (pkey == NULL) throw key_error ("CKey::CKey() : EC_KEY_new_by_curve_name failed"); + EC_KEY_set_conv_form (pkey, POINT_CONVERSION_COMPRESSED); + fSet = false; } CKey (const CKey& b) { pkey = EC_KEY_dup (b.pkey); - EC_KEY_set_conv_form (pkey, POINT_CONVERSION_COMPRESSED); if (pkey == NULL) throw key_error ("CKey::CKey(const CKey&) : EC_KEY_dup failed"); + EC_KEY_set_conv_form (pkey, POINT_CONVERSION_COMPRESSED); + fSet = b.fSet; }