mirror of https://github.com/poanetwork/gecko.git
Merge branch 'master' of github.com:ava-labs/gecko
This commit is contained in:
commit
181bd76b10
|
@ -335,10 +335,10 @@ func (t *Transitive) reinsertFrom(vdr ids.ShortID, vtxID ids.ID) (bool, error) {
|
||||||
|
|
||||||
func (t *Transitive) insertFrom(vdr ids.ShortID, vtx avalanche.Vertex) (bool, error) {
|
func (t *Transitive) insertFrom(vdr ids.ShortID, vtx avalanche.Vertex) (bool, error) {
|
||||||
issued := true
|
issued := true
|
||||||
vts := []avalanche.Vertex{vtx}
|
vertexHeap := newMaxVertexHeap()
|
||||||
for len(vts) > 0 {
|
vertexHeap.Push(vtx)
|
||||||
vtx := vts[0]
|
for vertexHeap.Len() > 0 {
|
||||||
vts = vts[1:]
|
vtx := vertexHeap.Pop()
|
||||||
|
|
||||||
if t.Consensus.VertexIssued(vtx) {
|
if t.Consensus.VertexIssued(vtx) {
|
||||||
continue
|
continue
|
||||||
|
@ -353,7 +353,7 @@ func (t *Transitive) insertFrom(vdr ids.ShortID, vtx avalanche.Vertex) (bool, er
|
||||||
t.sendRequest(vdr, parent.ID())
|
t.sendRequest(vdr, parent.ID())
|
||||||
issued = false
|
issued = false
|
||||||
} else {
|
} else {
|
||||||
vts = append(vts, parent)
|
vertexHeap.Push(parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue