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?