diff --git a/src/ripple/overlay/impl/TrafficCount.h b/src/ripple/overlay/impl/TrafficCount.h index 81385888d..85fa6a22d 100644 --- a/src/ripple/overlay/impl/TrafficCount.h +++ b/src/ripple/overlay/impl/TrafficCount.h @@ -53,6 +53,11 @@ public: , messagesIn (ts.messagesIn.load()) , messagesOut (ts.messagesOut.load()) { ; } + + operator bool () const + { + return messagesIn || messagesOut; + } }; @@ -107,9 +112,10 @@ public: for (auto& i : counts_) { - ret.emplace (std::piecewise_construct, - std::forward_as_tuple (getName (i.first)), - std::forward_as_tuple (i.second)); + if (i.second) + ret.emplace (std::piecewise_construct, + std::forward_as_tuple (getName (i.first)), + std::forward_as_tuple (i.second)); } return ret;