don't count connections and disconnections to ourself as sign of failure in tests

This commit is contained in:
arvidn 2019-03-29 23:17:34 +01:00 committed by Arvid Norberg
parent 51f77cc0a1
commit 1b79ce86e1
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,8 @@ int peer_disconnects = 0;
bool on_alert(alert const* a)
{
if (alert_cast<peer_disconnected_alert>(a))
auto const* const pd = alert_cast<peer_disconnected_alert>(a);
if (pd && pd->error != make_error_code(errors::self_connection))
++peer_disconnects;
else if (alert_cast<peer_error_alert>(a))
++peer_disconnects;

View File

@ -59,7 +59,8 @@ int peer_disconnects = 0;
bool on_alert(alert const* a)
{
if (alert_cast<peer_disconnected_alert>(a))
auto const* const pd = alert_cast<peer_disconnected_alert>(a);
if (pd && pd->error != make_error_code(errors::self_connection))
++peer_disconnects;
else if (alert_cast<peer_error_alert>(a))
++peer_disconnects;