0
I am interested in the difficulty right now. That is, the miners are working a block right now and they have a target. Both of the RPC commands "getmininginfo" (or "getdifficulty") and "getblocktemplate" can be used to get a number that represents a "difficulty".
"getmininginfo" (or "getdifficulty") gives a difficulty value directly. "getblocktemplate" gives the "target" and the "bits", both of which can be used to derive a difficulty value. I understand that miners work according to a "target." But, which target?
I list two possibilities below. Which (if either) is the correct case?
1) "getmininginfo" gives the difficulty right now, and "getblocktemplate" gives the difficulty for the next block under the assumption that this block will be solved within the next second.
2) "getblocktemplate" gives the difficulty right now (through the "bits" or "target"), and "getmininginfo" gives what the difficulty was for the most recently solved block.
If both of these are wrong, what exactly do the difficulties given by the two commands really represent?
so the target that the miners are working on right now is or is not the one given by "getblocktemplate" ? – SDiv – 2019-07-06T10:39:13.623
Miners are always working on the next block. So they want to meet the target of the next block, which is given by
getblocktemplate. – Andrew Chow – 2019-07-06T16:25:48.787