PackAndSignBlock generates the signature for the Block from the given PrivateKey.
(signer *ca.PrivateKey)
| 100 | |
| 101 | // PackAndSignBlock generates the signature for the Block from the given PrivateKey. |
| 102 | func (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. |
| 109 | func (b *Block) PackAsGenesis() (err error) { |