forked from TrueCloudLab/neoneo-go
core: drop some unused HeaderHashList functions
This commit is contained in:
parent
ddf0bfb1ef
commit
2354af463a
1 changed files with 1 additions and 14 deletions
|
@ -12,11 +12,6 @@ type HeaderHashList struct {
|
||||||
hashes []util.Uint256
|
hashes []util.Uint256
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewHeaderHashListFromBytes returns a new hash list from the given bytes.
|
|
||||||
func NewHeaderHashListFromBytes(b []byte) (*HeaderHashList, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewHeaderHashList returns a new pointer to a HeaderHashList.
|
// NewHeaderHashList returns a new pointer to a HeaderHashList.
|
||||||
func NewHeaderHashList(hashes ...util.Uint256) *HeaderHashList {
|
func NewHeaderHashList(hashes ...util.Uint256) *HeaderHashList {
|
||||||
return &HeaderHashList{
|
return &HeaderHashList{
|
||||||
|
@ -47,17 +42,9 @@ func (l *HeaderHashList) Last() util.Uint256 {
|
||||||
return l.hashes[l.Len()-1]
|
return l.hashes[l.Len()-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slice return a subslice of the underlying hashes.
|
|
||||||
// Subsliced from start to end.
|
|
||||||
// Example:
|
|
||||||
// headers := headerList.Slice(0, 2000)
|
|
||||||
func (l *HeaderHashList) Slice(start, end int) []util.Uint256 {
|
|
||||||
return l.hashes[start:end]
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteTo writes n underlying hashes to the given BinWriter
|
// WriteTo writes n underlying hashes to the given BinWriter
|
||||||
// starting from start.
|
// starting from start.
|
||||||
func (l *HeaderHashList) Write(bw *io.BinWriter, start, n int) error {
|
func (l *HeaderHashList) Write(bw *io.BinWriter, start, n int) error {
|
||||||
bw.WriteArray(l.Slice(start, start+n))
|
bw.WriteArray(l.hashes[start : start+n])
|
||||||
return bw.Err
|
return bw.Err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue