Client/Nonce: also reveal the last block of cycle.

Fix small delay in nonce revelations when the current head is the last
block of a cycle.
This commit is contained in:
Grégoire Henry 2017-09-22 17:36:43 +02:00 committed by Grégoire
parent 1af2885d72
commit 8da6c1cbf4
2 changed files with 7 additions and 2 deletions

View File

@ -74,4 +74,8 @@ let blocks_from_cycle cctxt block cycle =
let blocks =
Utils.remove_elem_from_list
(length - (1 + Int32.to_int (Raw_level.diff last first))) blocks in
return blocks
if Raw_level.(level.level = last) then
Client_node_rpcs.Blocks.hash cctxt block >>=? fun last ->
return (last :: blocks)
else
return blocks

View File

@ -87,8 +87,9 @@ let reveal_block_nonces cctxt ?force block_hashes =
do_reveal cctxt ?force cctxt.config.block blocks
let reveal_nonces cctxt ?force () =
let block = Client_rpcs.last_mined_block cctxt.config.block in
Client_mining_forge.get_unrevealed_nonces
cctxt ?force cctxt.config.block >>=? fun nonces ->
cctxt ?force block >>=? fun nonces ->
do_reveal cctxt ?force cctxt.config.block nonces
open Client_proto_args