Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed 0.80.0-rc1 #2207

Merged
merged 3 commits into from
Aug 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions src/ripple/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ class NetworkOPsImp final
, m_journal (journal)
, m_localTX (make_LocalTxs ())
, mMode (start_valid ? omFULL : omDISCONNECTED)
, mNeedNetworkLedger (false)
, m_amendmentBlocked (false)
, heartbeatTimer_ (io_svc)
, clusterTimer_ (io_svc)
, mConsensus (app,
Expand All @@ -210,7 +208,6 @@ class NetworkOPsImp final
, m_job_queue (job_queue)
, m_standalone (standalone)
, m_network_quorum (start_valid ? 0 : network_quorum)
, accounting_ ()
{
}

Expand Down Expand Up @@ -338,23 +335,23 @@ class NetworkOPsImp final

void needNetworkLedger () override
{
mNeedNetworkLedger = true;
needNetworkLedger_ = true;
}
void clearNeedNetworkLedger () override
{
mNeedNetworkLedger = false;
needNetworkLedger_ = false;
}
bool isNeedNetworkLedger () override
{
return mNeedNetworkLedger;
return needNetworkLedger_;
}
bool isFull () override
{
return !mNeedNetworkLedger && (mMode == omFULL);
return !needNetworkLedger_ && (mMode == omFULL);
}
bool isAmendmentBlocked () override
{
return m_amendmentBlocked;
return amendmentBlocked_;
}
void setAmendmentBlocked () override;
void consensusViewChange () override;
Expand Down Expand Up @@ -548,8 +545,8 @@ class NetworkOPsImp final

std::atomic<OperatingMode> mMode;

std::atomic <bool> mNeedNetworkLedger;
bool m_amendmentBlocked;
std::atomic <bool> needNetworkLedger_ {false};
std::atomic <bool> amendmentBlocked_ {false};

ClosureCounter<void, boost::system::error_code const&> waitHandlerCounter_;
boost::asio::steady_timer heartbeatTimer_;
Expand Down Expand Up @@ -597,7 +594,7 @@ class NetworkOPsImp final
DispatchState mDispatchState = DispatchState::none;
std::vector <TransactionStatus> mTransactions;

StateAccounting accounting_;
StateAccounting accounting_ {};
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -1258,7 +1255,7 @@ Json::Value NetworkOPsImp::getOwnerInfo (

void NetworkOPsImp::setAmendmentBlocked ()
{
m_amendmentBlocked = true;
amendmentBlocked_ = true;
setMode (omTRACKING);
}

Expand Down Expand Up @@ -1585,7 +1582,7 @@ void NetworkOPsImp::endConsensus ()
// Count number of peers that agree with us and UNL nodes whose
// validations we have for LCL. If the ledger is good enough, go to
// omTRACKING - TODO
if (!mNeedNetworkLedger)
if (!needNetworkLedger_)
setMode (omTRACKING);
}

Expand Down Expand Up @@ -1852,7 +1849,7 @@ void NetworkOPsImp::setMode (OperatingMode om)
om = omCONNECTED;
}

if ((om > omTRACKING) && m_amendmentBlocked)
if ((om > omTRACKING) && amendmentBlocked_)
om = omTRACKING;

if (mMode == om)
Expand Down Expand Up @@ -2151,7 +2148,7 @@ Json::Value NetworkOPsImp::getServerInfo (bool human, bool admin)

info [jss::server_state] = strOperatingMode ();

if (mNeedNetworkLedger)
if (needNetworkLedger_)
info[jss::network_ledger] = "waiting";

info[jss::validation_quorum] = static_cast<Json::UInt>(
Expand Down Expand Up @@ -2181,7 +2178,7 @@ Json::Value NetworkOPsImp::getServerInfo (bool human, bool admin)
info[jss::complete_ledgers] =
app_.getLedgerMaster ().getCompleteLedgers ();

if (m_amendmentBlocked)
if (amendmentBlocked_)
info[jss::amendment_blocked] = true;

auto const fp = m_ledgerMaster.getFetchPackCacheSize ();
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/BuildInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ char const* const versionString =
// The build version number. You must edit this for each release
// and follow the format described at http://semver.org/
//
"0.80.0-b5"
"0.80.0-rc1"

#if defined(DEBUG) || defined(SANITIZER)
"+"
Expand Down
9 changes: 5 additions & 4 deletions src/test/app/Flow_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,9 @@ struct Flow_test : public beast::unit_test::suite

auto const timeDelta = Env{*this}.closed ()->info ().closeTimeResolution;

for(auto const& d: {-timeDelta*100, +timeDelta*100}){
auto const closeTime = fix1141Time () + d;
for (auto const& d : {-100 * timeDelta, +100 * timeDelta})
{
auto const closeTime = fix1141Time () + d ;
Env env (*this, no_features);
env.close (closeTime);

Expand Down Expand Up @@ -1112,7 +1113,7 @@ struct Flow_test : public beast::unit_test::suite
using namespace jtx;
Env env(*this, with_features(featureFlow));
auto const timeDelta = env.closed ()->info ().closeTimeResolution;
auto const d = withFix ? timeDelta*100 : -timeDelta*100;
auto const d = withFix ? 100*timeDelta : -100*timeDelta;
auto closeTime = fix1443Time() + d;
env.close(closeTime);

Expand Down Expand Up @@ -1165,7 +1166,7 @@ struct Flow_test : public beast::unit_test::suite
using namespace jtx;
Env env(*this, with_features(featureFlow));
auto const timeDelta = env.closed ()->info ().closeTimeResolution;
auto const d = withFix ? timeDelta*100 : -timeDelta*100;
auto const d = withFix ? 100*timeDelta : -100*timeDelta;
auto closeTime = fix1449Time() + d;
env.close(closeTime);

Expand Down
7 changes: 3 additions & 4 deletions src/test/app/Offer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,10 @@ class Offer_test : public beast::unit_test::suite
for (int i=0;i<101;++i)
env (offer (carol, USD (1), EUR (2)));

for (auto timeDelta : {
- env.closed()->info().closeTimeResolution,
env.closed()->info().closeTimeResolution} )
for (auto d : {-1, 1})
{
auto const closeTime = STAmountSO::soTime + timeDelta;
auto const closeTime = STAmountSO::soTime +
d * env.closed()->info().closeTimeResolution;
env.close (closeTime);
*stAmountCalcSwitchover = closeTime > STAmountSO::soTime;
// Will fail without the underflow fix
Expand Down
7 changes: 7 additions & 0 deletions src/test/beast/aged_associative_container_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ class aged_associative_container_test_base : public unit_test::suite
return true;
}

template <class U>
bool operator!= (AllocT <U> const& o) const
{
return !(*this == o);
}


T* allocate (std::size_t n, T const* = 0)
{
return static_cast <T*> (
Expand Down
4 changes: 2 additions & 2 deletions src/test/ledger/Invariants_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Invariants_test : public beast::unit_test::suite
auto const sle = ac.view().peek (keylet::account(A1.id()));
if(! sle)
return false;
STAmount nonNative {A2["USD"](51)};
STAmount nonNative (A2["USD"](51));
sle->setFieldAmount (sfBalance, nonNative);
ac.view().update (sle);
return true;
Expand Down Expand Up @@ -366,7 +366,7 @@ class Invariants_test : public beast::unit_test::suite
return false;
auto sleNew = std::make_shared<SLE> (
keylet::escrow(A1, (*sle)[sfSequence] + 2));
STAmount nonNative {A2["USD"](51)};
STAmount nonNative (A2["USD"](51));
sleNew->setFieldAmount (sfAmount, nonNative);
ac.view().insert (sleNew);
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/test/ledger/PaymentSandbox_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ class PaymentSandbox_test : public beast::unit_test::suite
STAmount hugeAmt (issue, STAmount::cMaxValue, STAmount::cMaxOffset - 1,
false, false, STAmount::unchecked{});

for (auto timeDelta : {-env.closed ()->info ().closeTimeResolution,
env.closed ()->info ().closeTimeResolution})
for (auto d : {-1, 1})
{
auto const closeTime = fix1141Time () + timeDelta;
auto const closeTime = fix1141Time () +
d * env.closed()->info().closeTimeResolution;
env.close (closeTime);
ApplyViewImpl av (&*env.current (), tapNONE);
PaymentSandbox pv (&av);
Expand Down