Closed domob1812 closed 5 years ago
Note that adding this data to the persistent storage is actually mostly redundant. Instead, we could just keep the current height in memory, and update it when attaching/detaching blocks. Whenever needed (i.e. after starting the game daemon), we could just call getblockheader
on Xaya Core to initialise the value.
That way, we do not need to complicate the storage unnecessarily, but we also avoid most of the unnecessary RPCs.
Fixed with #32.
RPCs that return the game state (like the default
getcurrentstate
andGetCustomStateData
) include the block hash to which the state corresponds. This identifies the block uniquely - but it would be nice to have also the block height there. (It can be retrieved by frontends throughgetblockheader
with the block hash, but that is an additional RPC that is unnecessary.)For this, we need to extend the storage to include the block height also with the current game state. A simpler implementation could just call
getblockheader
from the game daemon.