Exemplo n.º 1
0
func NewReadableBlockHeader(b *coin.BlockHeader) ReadableBlockHeader {
	return ReadableBlockHeader{
		BkSeq:             b.BkSeq,
		BlockHash:         b.Hash().Hex(),
		PreviousBlockHash: b.PrevHash.Hex(),
		Time:              b.Time,
		Fee:               b.Fee,
		Version:           b.Version,
		BodyHash:          b.BodyHash.Hex(),
	}
}
Exemplo n.º 2
0
func newBlockHeader(prev coin.BlockHeader, unspent coin.UnspentPool, currentTime,
	fee uint64, body coin.BlockBody) coin.BlockHeader {
	prevHash := prev.Hash()
	return coin.BlockHeader{
		BodyHash: body.Hash(),
		Version:  prev.Version,
		PrevHash: prevHash,
		Time:     currentTime,
		BkSeq:    prev.BkSeq + 1,
		Fee:      fee,
		UxHash:   getUxHash(unspent),
	}
}