Commit fc2090a3 authored by caopingcp's avatar caopingcp Committed by vipwzw

vrf hash start from height 1

parent f928cd84
......@@ -366,11 +366,14 @@ func (client *Client) CheckBlock(parent *types.Block, current *types.BlockDetail
}
//vrf verify
if types.IsDappFork(current.Block.Height, ty.TicketX, "ForkTicketVrf") {
var input []byte
if current.Block.Height > 1 {
LastTicketAction, err := client.getMinerTx(parent)
if err != nil {
return err
}
input := LastTicketAction.GetMiner().GetVrfHash()
input = LastTicketAction.GetMiner().GetVrfHash()
}
if input == nil {
input = miner.PrivHash
}
......@@ -639,11 +642,14 @@ func (client *Client) addMinerTx(parent, block *types.Block, diff *big.Int, priv
miner.PrivHash = privHash
//add vrf
if types.IsDappFork(block.Height, ty.TicketX, "ForkTicketVrf") {
var input []byte
if block.Height > 1 {
LastTicketAction, err := client.getMinerTx(parent)
if err != nil {
return err
}
input := LastTicketAction.GetMiner().GetVrfHash()
input = LastTicketAction.GetMiner().GetVrfHash()
}
if input == nil {
input = miner.PrivHash
}
......
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