headbuffer

package
v1.26.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0, MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeadChangeStackBuffer

type HeadChangeStackBuffer struct {
	// contains filtered or unexported fields
}

func NewHeadChangeStackBuffer

func NewHeadChangeStackBuffer(size int) *HeadChangeStackBuffer

NewHeadChangeStackBuffer buffer HeadChange events to avoid having to deal with revert changes. Initialized size should be the average reorg size + 1

func (*HeadChangeStackBuffer) Pop

func (h *HeadChangeStackBuffer) Pop()

Pop removes the last added HeadChange

func (*HeadChangeStackBuffer) Push

func (h *HeadChangeStackBuffer) Push(hc *api.HeadChange) (rethc *api.HeadChange)

Push adds a HeadChange to stack buffer. If the length of the stack buffer grows larger than the initizlized size, the oldest HeadChange is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL