mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
test: make CAddress in functional tests comparable
This way we can compare CAddress objects using `==` or even arrays of CAddress using `array1 == array2`.
This commit is contained in:
parent
33e211d2a4
commit
e7468139a1
@ -229,6 +229,9 @@ class CAddress:
|
||||
self.ip = "0.0.0.0"
|
||||
self.port = 0
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.net == other.net and self.ip == other.ip and self.nServices == other.nServices and self.port == other.port and self.time == other.time
|
||||
|
||||
def deserialize(self, f, *, with_time=True):
|
||||
"""Deserialize from addrv1 format (pre-BIP155)"""
|
||||
if with_time:
|
||||
|
Loading…
x
Reference in New Issue
Block a user