示例#1
0
func createGenesisSignature(master wallet.WalletEntry) coin.Sig {
	c := visor.NewVisorConfig()
	bc := coin.NewBlockchain()
	gb := bc.CreateGenesisBlock(master.Address, c.GenesisTimestamp,
		c.GenesisCoinVolume)
	return coin.SignHash(gb.HashHeader(), master.Secret)
}
示例#2
0
// Signs a block for master.  Will panic if anything is invalid
func (self *Visor) SignBlock(b coin.Block) SignedBlock {
	if !self.Config.IsMaster {
		log.Panic("Only master chain can sign blocks")
	}
	sig := coin.SignHash(b.HashHeader(), self.Config.MasterKeys.Secret)
	sb := SignedBlock{
		Block: b,
		Sig:   sig,
	}
	return sb
}
示例#3
0
// Signs a block for master.  Will panic if anything is invalid
func (self *Blockchain) signBlock(b coin.Block) SignedBlock {
	if !self.IsMaster {
		log.Panic("Only master chain can sign blocks")
	}
	sig := coin.SignHash(b.HashHeader(), self.SecKey)
	sb := SignedBlock{
		Block: b,
		Sig:   sig,
	}
	return sb
}