block: remove Base.Verify()

It's a no-op and there is nothing we can do about it, header contents could
only be checked against chain state, there is nothing to check for internal
consistency.
This commit is contained in:
Roman Khimov 2020-09-16 12:31:48 +03:00
parent d2b37adf95
commit 2e876b5593
2 changed files with 0 additions and 13 deletions

View file

@ -64,12 +64,6 @@ type baseAux struct {
Witnesses []transaction.Witness `json:"witnesses"` Witnesses []transaction.Witness `json:"witnesses"`
} }
// Verify verifies the integrity of the Base.
func (b *Base) Verify() bool {
// TODO: Need a persisted blockchain for this.
return true
}
// Hash returns the hash of the block. // Hash returns the hash of the block.
func (b *Base) Hash() util.Uint256 { func (b *Base) Hash() util.Uint256 {
if b.hash.Equals(util.Uint256{}) { if b.hash.Equals(util.Uint256{}) {

View file

@ -264,9 +264,6 @@ func (bc *Blockchain) init() error {
} }
headerSliceReverse(headers) headerSliceReverse(headers)
for _, h := range headers { for _, h := range headers {
if !h.Verify() {
return fmt.Errorf("bad header %d/%s in the storage", h.Index, h.Hash())
}
bc.headerList.Add(h.Hash()) bc.headerList.Add(h.Hash())
} }
} }
@ -506,10 +503,6 @@ func (bc *Blockchain) addHeaders(verify bool, headers ...*block.Header) (err err
if int(h.Index) < headerList.Len() { if int(h.Index) < headerList.Len() {
continue continue
} }
if !h.Verify() {
err = fmt.Errorf("header %v is invalid", h)
return
}
if err = bc.processHeader(h, batch, headerList); err != nil { if err = bc.processHeader(h, batch, headerList); err != nil {
return return
} }