mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-04 04:04:19 +02:00
test: refactor: remove binascii from test_framework
This commit is contained in:
@@ -12,7 +12,6 @@ import socket
|
||||
import struct
|
||||
import array
|
||||
import os
|
||||
from binascii import unhexlify
|
||||
|
||||
# STATE_ESTABLISHED = '01'
|
||||
# STATE_SYN_SENT = '02'
|
||||
@@ -44,7 +43,7 @@ def _remove_empty(array):
|
||||
def _convert_ip_port(array):
|
||||
host,port = array.split(':')
|
||||
# convert host from mangled-per-four-bytes form as used by kernel
|
||||
host = unhexlify(host)
|
||||
host = bytes.fromhex(host)
|
||||
host_out = ''
|
||||
for x in range(0, len(host) // 4):
|
||||
(val,) = struct.unpack('=I', host[x*4:(x+1)*4])
|
||||
|
Reference in New Issue
Block a user