sigHash returns hash of header
(header *Header)
| 165 | |
| 166 | // sigHash returns hash of header |
| 167 | func sigHash(header *Header) (hash common.Hash) { |
| 168 | hasher := sha3.NewKeccak256() |
| 169 | err := rlp.Encode(hasher, []interface{}{ |
| 170 | header.ParentHash, |
| 171 | header.Coinbase, |
| 172 | header.StateRoot, |
| 173 | header.TxsRoot, |
| 174 | header.ReceiptsRoot, |
| 175 | header.LogsBloom, |
| 176 | header.Number, |
| 177 | header.GasLimit, |
| 178 | header.GasUsed, |
| 179 | header.Time, |
| 180 | header.Dpor.Proposers, |
| 181 | header.Dpor.Validators, |
| 182 | header.Extra, |
| 183 | common.Hash{}, |
| 184 | BlockNonce{}, |
| 185 | }) |
| 186 | if err != nil { |
| 187 | log.Error("invalid hash encoding", "error", err) |
| 188 | return common.Hash{} |
| 189 | } |
| 190 | hasher.Sum(hash[:0]) |
| 191 | return hash |
| 192 | } |
| 193 | |
| 194 | // HashNoNonce returns the hash which is used as input for the proof-of-work search. |
| 195 | func (h *Header) HashNoNonce() common.Hash { |