Skip to content

Commit ca499fa

Browse files
committed
fix doubleentry decision
1 parent f969261 commit ca499fa

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

ex/lib/bic/epoch.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ defmodule BIC.Epoch do
111111
"6V65RDdHU8T7TbFxGh42sp2hmXrfmRRFbuTjmJv4yysikdNhtdSC2yMxr7L95gDCKn",
112112
"6V668VVot57QvwjY2s1w8RbgeYE2ftBCxUt1uNp5mfJgXPiUoepteUguXUSYpf3a7E"
113113
] |> Enum.map(& Base58.decode(&1))
114+
def peddlebike67() do @peddlebike67 end
114115

115116
def call(:submit_sol, env, [sol]) do
116117
hash = Blake3.hash(sol)

ex/lib/consensus/fabric_gen.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ defmodule FabricGen do
147147
cond do
148148
!mymut ->
149149
IO.puts "softfork: rewind to entry #{Base58.encode(best_entry.hash)}, height #{best_entry.header_unpacked.height}"
150-
{entry, mut_hash, score} = List.first(best_entry_for_height(next_height - 1))
151-
true = Consensus.chain_rewind(entry.hash)
150+
hash = try do
151+
{entry, mut_hash, score} = List.first(best_entry_for_height(next_height - 1))
152+
entry.hash
153+
catch
154+
_,_ -> Consensus.chain_tip()
155+
end
156+
true = Consensus.chain_rewind(hash)
152157
proc_consensus()
153158

154159
mut_hash != mymut.mutations_hash ->

0 commit comments

Comments
 (0)