Many improvements for the event scheduler
Another big change: maintaining an outstanding interests and
re-expressing this interest every 4 seconds (or 4 seconds after interest
is satisfied and expressed again)
Initial testing for SyncLogic
diff --git a/model/sync-full-state.cc b/model/sync-full-state.cc
index 748e408..d01460e 100644
--- a/model/sync-full-state.cc
+++ b/model/sync-full-state.cc
@@ -64,18 +64,24 @@
{
if (m_digest == 0)
{
- // std::cout << "getDigest: ";
m_digest = make_shared<Digest> ();
- BOOST_FOREACH (LeafConstPtr leaf, m_leaves.get<ordered> ())
+ if (m_leaves.get<ordered> ().size () > 0)
{
- FullLeafConstPtr fullLeaf = dynamic_pointer_cast<const FullLeaf> (leaf);
- BOOST_ASSERT (fullLeaf != 0);
- *m_digest << fullLeaf->getDigest ();
- // std::cout << *leaf << "[" << fullLeaf->getDigest () << "] ";
+ BOOST_FOREACH (LeafConstPtr leaf, m_leaves.get<ordered> ())
+ {
+ FullLeafConstPtr fullLeaf = dynamic_pointer_cast<const FullLeaf> (leaf);
+ BOOST_ASSERT (fullLeaf != 0);
+ *m_digest << fullLeaf->getDigest ();
+ // std::cout << *leaf << "[" << fullLeaf->getDigest () << "] ";
+ }
+ m_digest->finalize ();
}
- // std::cout << "\n";
+ else
+ {
+ std::istringstream is ("00"); //zero state
+ is >> *m_digest;
+ }
}
- m_digest->finalize ();
return m_digest;
}