In disconnect_p2ps(), wait for p2p connections to disappear from getpeerinfo()

This commit is contained in:
Alexander Block 2020-04-10 19:24:33 +02:00
parent 76d7b17dcd
commit 305485418b

View File

@ -15,6 +15,7 @@ import subprocess
import time
from .authproxy import JSONRPCException
from .messages import MY_SUBVERSION
from .util import (
assert_equal,
delete_cookie_file,
@ -223,6 +224,14 @@ class TestNode():
p.peer_disconnect()
del self.p2ps[:]
# wait for p2p connections to disappear from getpeerinfo()
def check_peers():
for p in self.getpeerinfo():
if p['subver'] == MY_SUBVERSION.decode():
return False
return True
wait_until(check_peers, timeout=5)
class TestNodeCLIAttr:
def __init__(self, cli, command):
self.cli = cli