Verified Commit 16facd87 authored by vbot's avatar vbot Committed by Romain

Baker: filter bad endorsements when using client's "bake for"

parent 38bc3e98
......@@ -162,13 +162,18 @@ let compute_endorsing_power cctxt ~chain ~block operations =
(fun sum -> function
| { Alpha_context.protocol_data =
Operation_data {contents = Single (Endorsement _); _};
_ } as op ->
_ } as op -> (
Delegate_services.Endorsing_power.get
cctxt
(chain, block)
op
chain_id
>>=? fun power -> return (sum + power) | _ -> return sum)
>>= function
| Error _ ->
(* Filters invalid endorsements *)
return sum
| Ok power ->
return (sum + power) ) | _ -> return sum)
0
operations
......
......@@ -162,13 +162,18 @@ let compute_endorsing_power cctxt ~chain ~block operations =
(fun sum -> function
| { Alpha_context.protocol_data =
Operation_data {contents = Single (Endorsement _); _};
_ } as op ->
_ } as op -> (
Delegate_services.Endorsing_power.get
cctxt
(chain, block)
op
chain_id
>>=? fun power -> return (sum + power) | _ -> return sum)
>>= function
| Error _ ->
(* Filters invalid endorsements *)
return sum
| Ok power ->
return (sum + power) ) | _ -> return sum)
0
operations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment