Merge pull request #4056 from zgfzgf/tipset-equals
optimize Tipset equals
This commit is contained in:
commit
2633198e6c
@ -167,12 +167,16 @@ func (ts *TipSet) Equals(ots *TipSet) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if len(ts.blks) != len(ots.blks) {
|
||||
if ts.height != ots.height {
|
||||
return false
|
||||
}
|
||||
|
||||
for i, b := range ts.blks {
|
||||
if b.Cid() != ots.blks[i].Cid() {
|
||||
if len(ts.cids) != len(ots.cids) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i, cid := range ts.cids {
|
||||
if cid != ots.cids[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user