route

package
v0.0.0-...-9f791b1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanceledRoute

type CanceledRoute struct {
	Route  *State
	Reason string
}

CanceledRoute 保存失败原因

type RoutesState

type RoutesState struct {
	AvailableRoutes []*State
	IgnoredRoutes   []*State
	RefundedRoutes  []*State
	CanceledRoutes  []*CanceledRoute
}

RoutesState is Routing state.

func NewRoutesState

func NewRoutesState(availables []*State) *RoutesState

NewRoutesState create routes state from availabes routes

type State

type State struct {
	ChannelIdentifier common.Hash      //崩溃恢复的时候需要	// Needed when handling crash cases.
	IsSend            bool             //用这个 route 来发送还是接收?	// whether this route is used to send or receive.
	Fee               *big.Int         // how much fee to this channel charge charge .
	TotalFee          *big.Int         // how much fee for all path when initiator use this route
	Path              []common.Address // 2019-03消息升级,路由中保存该条路径上所有节点,有序
	// contains filtered or unexported fields
}

State describes a route state 路由状态我如何收到的或者发送MediatedTransfer

  • State : describe a route state
  • route state means how does this participant get or send MediatedTransfer.

func NewState

func NewState(ch *channel.Channel, path []common.Address) *State

NewState create route state

func (*State) AvailableBalance

func (rs *State) AvailableBalance() *big.Int

AvailableBalance avaialabe balance of this route

func (*State) CanContinueTransfer

func (rs *State) CanContinueTransfer() bool

CanContinueTransfer can continue on this hop node

func (*State) CanTransfer

func (rs *State) CanTransfer() bool

CanTransfer can transfer on this hop node

func (*State) Channel

func (rs *State) Channel() *channel.Channel

Channel return Channel

func (*State) ClosedBlock

func (rs *State) ClosedBlock() int64

ClosedBlock return closedBlock of this route channel

func (*State) HopNode

func (rs *State) HopNode() common.Address

HopNode hop node

func (*State) RevealTimeout

func (rs *State) RevealTimeout() int

RevealTimeout reveal timeout of this channel

func (*State) SetClosedBlock

func (rs *State) SetClosedBlock(blockNumbder int64)

SetClosedBlock set closed block ,for test only

func (*State) SetState

func (rs *State) SetState(state channeltype.State)

SetState for test only,

func (*State) SettleTimeout

func (rs *State) SettleTimeout() int

SettleTimeout settle timeout of this channel

func (*State) State

func (rs *State) State() channeltype.State

State of route channel

func (*State) StateName

func (rs *State) StateName() string

StateName return name of the state

Jump to

Keyboard shortcuts

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