SetKnownHead sets the known head block hash and number
(hash common.Hash, number uint64)
| 124 | |
| 125 | // SetKnownHead sets the known head block hash and number |
| 126 | func (hc *HeaderChain) SetKnownHead(hash common.Hash, number uint64) { |
| 127 | hc.knownHeadLock.Lock() |
| 128 | defer hc.knownHeadLock.Unlock() |
| 129 | |
| 130 | if number > hc.knownHeadNumber { |
| 131 | hc.knownHeadHash, hc.knownHeadNumber = hash, number |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | // GetBlockNumber retrieves the block number belonging to the given hash |
| 136 | // from the cache or database |
no test coverage detected