Skip to content

Commit

Permalink
add quorum_sets to the scp dump
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsieurNicolas committed Nov 5, 2015
1 parent 1ac1ce7 commit e706bd6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/scp/Slot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,26 @@ Slot::dumpInfo(Json::Value& ret)

Json::Value& slotValue = slots[std::to_string(mSlotIndex)];

std::map<Hash, SCPQuorumSetPtr> qSetsUsed;

int count = 0;
for (auto const& item : mStatementsHistory)
{
Json::Value& v = slotValue["statements"][count++];
v.append(envToStr(item.first));
v.append(item.second);

Hash const& qSetHash =
getCompanionQuorumSetHashFromStatement(item.first);
auto qSet = getSCPDriver().getQSet(qSetHash);
qSetsUsed.insert(std::make_pair(qSetHash, qSet));
}

auto& qSets = slotValue["quorum_sets"];
for (auto const& q : qSetsUsed)
{
auto& qs = qSets[hexAbbrev(q.first)];
getLocalNode()->toJson(*q.second, qs);
}

slotValue["validated"] = mFullyValidated;
Expand Down Expand Up @@ -326,7 +340,7 @@ Slot::envToStr(SCPStatement const& st) const
{
std::ostringstream oss;

Hash qSetHash = getCompanionQuorumSetHashFromStatement(st);
Hash const& qSetHash = getCompanionQuorumSetHashFromStatement(st);

oss << "{ENV@" << getSCPDriver().toShortString(st.nodeID) << " | "
<< " i: " << st.slotIndex;
Expand Down

5 comments on commit e706bd6

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jedmccaleb
at MonsieurNicolas@e706bd6

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging MonsieurNicolas/stellar-core/scpVerbose = e706bd6 into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MonsieurNicolas/stellar-core/scpVerbose = e706bd6 merged ok, testing candidate = 5167ebe

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 5167ebe

Please sign in to comment.