So my next ask is to figure out how to match a submitted getwork to the server it came from.
i.e.
- client requests work
- proxy returns work from one of several servers
- proxy keeps mapping of work sent to upstream server
- Client submits completed work
- proxy verifies work and then looks up mapping to find correct server to submit to
The doco is a bit hazy on this. I presume from here:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_listthat the data is the actual block. Proxy verifies by double hashing it and comparing difficulty. But how do I match it? All the proxy has is the original getwork request with:
"midstate" : precomputed hash state after hashing the first half of the data
"data" : block data
"hash1" : formatted hash buffer for second hash
"target" : little endian hash target
Is the block data contained within the block submitted by the client? According to this page:
https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers There's no data in the block header.
The target is useless since they'll all have the same one. No idea what the midstate and hash1 fields are. So is there any what to identify it as the result of a particular work request or is it simply not built into the design to be able to match like this?