diff options
author | changhong <changhong.yu@shanbay.com> | 2017-05-11 09:55:48 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-05-25 22:14:33 +0800 |
commit | 17f0b1194232ebebc4e14f905e6e1d2d148aa5b6 (patch) | |
tree | 60663b43bff6e8df5b5a4693cbabc7756482136e /core/headerchain.go | |
parent | 07aae19e5da66ed404453e6be70ab84db516207b (diff) | |
download | go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.tar go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.tar.gz go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.tar.bz2 go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.tar.lz go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.tar.xz go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.tar.zst go-tangerine-17f0b1194232ebebc4e14f905e6e1d2d148aa5b6.zip |
core: typos and comments improve
1. fix typos
2. methods recevier of struct should be same
3. comments improve
(cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
Diffstat (limited to 'core/headerchain.go')
-rw-r--r-- | core/headerchain.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/core/headerchain.go b/core/headerchain.go index 9bb7f1793..6ec44b61d 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -201,15 +201,6 @@ func (hc *HeaderChain) WriteHeader(header *types.Header) (status WriteStatus, er // header writes should be protected by the parent chain mutex individually. type WhCallback func(*types.Header) error -// InsertHeaderChain attempts to insert the given header chain in to the local -// chain, possibly creating a reorg. If an error is returned, it will return the -// index number of the failing header as well an error describing what went wrong. -// -// The verify parameter can be used to fine tune whether nonce verification -// should be done or not. The reason behind the optional check is because some -// of the header retrieval mechanisms already need to verfy nonces, as well as -// because nonces can be verified sparsely, not needing to check each. - func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int) (int, error) { // Do a sanity check that the provided chain is actually ordered and linked for i := 1; i < len(chain); i++ { @@ -257,6 +248,14 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int) return 0, nil } +// InsertHeaderChain attempts to insert the given header chain in to the local +// chain, possibly creating a reorg. If an error is returned, it will return the +// index number of the failing header as well an error describing what went wrong. +// +// The verify parameter can be used to fine tune whether nonce verification +// should be done or not. The reason behind the optional check is because some +// of the header retrieval mechanisms already need to verfy nonces, as well as +// because nonces can be verified sparsely, not needing to check each. func (hc *HeaderChain) InsertHeaderChain(chain []*types.Header, writeHeader WhCallback, start time.Time) (int, error) { // Collect some import statistics to report on stats := struct{ processed, ignored int }{} |