MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / PackAndSignBlock

Method PackAndSignBlock

types/block.go:102–106  ·  view source on GitHub ↗

PackAndSignBlock generates the signature for the Block from the given PrivateKey.

(signer *ca.PrivateKey)

Source from the content-addressed store, hash-verified

100
101// PackAndSignBlock generates the signature for the Block from the given PrivateKey.
102func (b *Block) PackAndSignBlock(signer *ca.PrivateKey) (err error) {
103 // Calculate merkle root
104 b.SignedHeader.MerkleRoot = b.computeMerkleRoot()
105 return b.SignedHeader.Sign(signer)
106}
107
108// PackAsGenesis generates the hash of the genesis block.
109func (b *Block) PackAsGenesis() (err error) {

Callers 5

produceBlockMethod · 0.45
generateRandomBlockFunction · 0.45
CreateRandomBlockFunction · 0.45
createRandomBlockFunction · 0.45
produceBlockMethod · 0.45

Calls 2

computeMerkleRootMethod · 0.95
SignMethod · 0.65

Tested by 2

generateRandomBlockFunction · 0.36
createRandomBlockFunction · 0.36