1
0

Unify message IDs between network and interfaces

Previously network.py had its own idea of request IDs,
and each interface had its own which was sent on the wire.
The interface would jump through hoops to translate one
to the other.

This unifies them so that a message ID is passed when
queueing a request, in addition to the method and params.
network.py is now solely responsible for message ID management.

Apart from being simpler and clearer, this also should be faster
as there is much less data structure manipulation and rebuilding
happening.
This commit is contained in:
Neil Booth
2015-09-09 20:41:08 +09:00
parent ec9eccd0dd
commit 6f1367fea6
7 changed files with 98 additions and 110 deletions

View File

@@ -10,7 +10,7 @@ set_verbosity(False)
config = SimpleConfig()
servers = filter_protocol(protocol = 't')
results = util.send_request(servers, {'method':'blockchain.headers.subscribe', 'params':[]})
results = util.send_request(servers, 'blockchain.headers.subscribe', [])
d = defaultdict(int)