mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
35 lines
745 B
Go
35 lines
745 B
Go
|
package aura
|
||
|
|
||
|
import (
|
||
|
"container/list"
|
||
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
||
|
)
|
||
|
|
||
|
// nolint
|
||
|
type unAssembledHeader struct {
|
||
|
hash libcommon.Hash
|
||
|
number uint64
|
||
|
signers []libcommon.Address
|
||
|
}
|
||
|
type unAssembledHeaders struct {
|
||
|
l *list.List
|
||
|
}
|
||
|
|
||
|
func (u unAssembledHeaders) PushBack(header *unAssembledHeader) { u.l.PushBack(header) }
|
||
|
func (u unAssembledHeaders) PushFront(header *unAssembledHeader) { u.l.PushFront(header) }
|
||
|
func (u unAssembledHeaders) Pop() *unAssembledHeader {
|
||
|
e := u.l.Front()
|
||
|
if e == nil {
|
||
|
return nil
|
||
|
}
|
||
|
u.l.Remove(e)
|
||
|
return e.Value.(*unAssembledHeader)
|
||
|
}
|
||
|
func (u unAssembledHeaders) Front() *unAssembledHeader {
|
||
|
e := u.l.Front()
|
||
|
if e == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return e.Value.(*unAssembledHeader)
|
||
|
}
|