Merge pull request #938 from coolcottontail/fix_vrf_bug

fix VDF bug
pull/956/head
coolcottontail 6 years ago committed by GitHub
commit 791d68bc8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      consensus/consensus_service.go
  2. 7
      node/node_handler.go

@ -45,6 +45,10 @@ func (consensus *Consensus) GetNextRnd() ([32]byte, [32]byte, error) {
return [32]byte{}, [32]byte{}, errors.New("No available randomness")
}
vdfOutput := consensus.pendingRnds[0]
//pop the first vdfOutput from the list
consensus.pendingRnds = consensus.pendingRnds[1:]
rnd := [32]byte{}
blockHash := [32]byte{}
copy(rnd[:], vdfOutput[:32])

@ -413,13 +413,6 @@ func (node *Node) PostConsensusProcessing(newBlock *types.Block) {
}()
}
// ConfirmedBlockChannel which is listened by drand leader who will initiate DRG if its a epoch block (first block of a epoch)
if node.DRand != nil {
go func() {
node.ConfirmedBlockChannel <- newBlock
}()
}
// TODO: update staking information once per epoch.
node.UpdateStakingList(node.QueryStakeInfo())
node.printStakingList()

Loading…
Cancel
Save