network: allow mixed protocols among interfaces
Previously all the interfaces used either "t" or "s". Now the network only tries to use "s" for all interfaces, except for the main interface, which the user can manually specify to use "t". (so e.g. if you run with "--server localhost:50002:t", the main server will use "t", but all the rest will use "s")
This commit is contained in:
@@ -17,7 +17,7 @@ network.start()
|
||||
async def f():
|
||||
try:
|
||||
peers = await network.get_peers()
|
||||
peers = filter_protocol(peers, 's')
|
||||
peers = filter_protocol(peers)
|
||||
results = await network.send_multiple_requests(peers, 'blockchain.headers.subscribe', [])
|
||||
for server, header in sorted(results.items(), key=lambda x: x[1].get('height')):
|
||||
height = header.get('height')
|
||||
|
||||
@@ -23,7 +23,7 @@ network.start()
|
||||
async def f():
|
||||
try:
|
||||
peers = await network.get_peers()
|
||||
peers = filter_protocol(peers, 's')
|
||||
peers = filter_protocol(peers)
|
||||
results = await network.send_multiple_requests(peers, 'blockchain.transaction.get', [txid])
|
||||
r1, r2 = [], []
|
||||
for k, v in results.items():
|
||||
|
||||
Reference in New Issue
Block a user