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:
parent
1af2885d72
commit
8da6c1cbf4
@ -74,4 +74,8 @@ let blocks_from_cycle cctxt block cycle =
|
|||||||
let blocks =
|
let blocks =
|
||||||
Utils.remove_elem_from_list
|
Utils.remove_elem_from_list
|
||||||
(length - (1 + Int32.to_int (Raw_level.diff last first))) blocks in
|
(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
|
||||||
|
@ -87,8 +87,9 @@ let reveal_block_nonces cctxt ?force block_hashes =
|
|||||||
do_reveal cctxt ?force cctxt.config.block blocks
|
do_reveal cctxt ?force cctxt.config.block blocks
|
||||||
|
|
||||||
let reveal_nonces cctxt ?force () =
|
let reveal_nonces cctxt ?force () =
|
||||||
|
let block = Client_rpcs.last_mined_block cctxt.config.block in
|
||||||
Client_mining_forge.get_unrevealed_nonces
|
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
|
do_reveal cctxt ?force cctxt.config.block nonces
|
||||||
|
|
||||||
open Client_proto_args
|
open Client_proto_args
|
||||||
|
Loading…
Reference in New Issue
Block a user