return nil
}
dpos.Authorize(config.CommonConfig.Consensus.Dpos.Coinbase)
- /*
- for index, xpub := range consensus.ActiveNetParams.SignBlockXPubs {
- pubHash := crypto.Ripemd160(xpub.PublicKey())
- address, _ := common.NewPeginAddressWitnessScriptHash(pubHash, &consensus.ActiveNetParams)
- control, _ := vmutil.P2WPKHProgram([]byte(pubHash))
- //key := hex.EncodeToString(control)
- //authoritys[key] = xpub.String()
- authoritys[address.EncodeAddress()] = xpub.String()
- if accountManager.IsLocalControlProgram(control) {
- position = uint64(index)
- dpos.Authorize(address.EncodeAddress())
- }
- }
- */
- //c.SetAuthoritys(authoritys)
- //c.SetPosition(position)
c.SetConsensusEngine(dpos)
ConsensusEngine = dpos
return &Miner{
*/
isSeal := true
if isSeal {
- block, err := mining.NewBlockTemplate1(m.chain, m.txPool, m.accountManager, m.engine)
+ block, err := mining.NewBlockTemplate(m.chain, m.txPool, m.accountManager, m.engine)
if err != nil {
log.Errorf("Mining: failed on create NewBlockTemplate: %v", err)
time.Sleep(3 * time.Second)