blockfinder

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockfinder

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

Blockfinder uses the backend to find the last block before a given timestamp. For each block, the block's time is computed by taking the median of the previous 11 blocks.

func New

func New(b backend.Backend) *Blockfinder

New instantiates a new Blockfinder

func (*Blockfinder) Search

func (bf *Blockfinder) Search(timestamp time.Time) (uint32, time.Time, time.Time)

Returns block height, block median, block timestamp

Jump to

Keyboard shortcuts

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