mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05: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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue