msgbase

package
v6.5.0-p2p2-beta1+inco... Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyMessage

func VerifyMessage(s interfaces.Signable) (bool, error)

Types

type MessageBase

type MessageBase struct {
	FullMsgHash interfaces.IHash

	Origin        int    // Set and examined on a server, not marshalled with the message
	NetworkOrigin string // Hash of the network peer/connection where the message is from
	Peer2Peer     bool   // The nature of this message type, not marshalled with the message
	LocalOnly     bool   // This message is only a local message, is not broadcast and may skip verification
	Network       bool   // If we got this message from the network, it is true.  Not marsheled.
	FullBroadcast bool   // This is used for messages with no missing message support e.g. election related messages

	NoResend  bool // Don't resend this message if true.
	ResendCnt int  // Put a limit on resends

	LeaderChainID interfaces.IHash
	MsgHash       interfaces.IHash // Cache of the hash of a message
	RepeatHash    interfaces.IHash // Cache of the hash of a message
	VMIndex       int              // The Index of the VM responsible for this message.
	VMHash        []byte           // Basis for selecting a VMIndex
	Minute        byte

	Stalled     bool // This message is currently stalled
	MarkInvalid bool
	Sigvalid    bool
	// contains filtered or unexported fields
}

func (*MessageBase) Expire

func (m *MessageBase) Expire(s interfaces.IState) (rtn bool)

Try and Resend. Return true if we should keep the message, false if we should give up.

func (*MessageBase) GetFullMsgHash

func (m *MessageBase) GetFullMsgHash() (rval interfaces.IHash)

func (*MessageBase) GetLeaderChainID

func (m *MessageBase) GetLeaderChainID() (rval interfaces.IHash)

func (*MessageBase) GetMinute

func (m *MessageBase) GetMinute() byte

func (*MessageBase) GetNetworkOrigin

func (m *MessageBase) GetNetworkOrigin() string

func (*MessageBase) GetNoResend

func (m *MessageBase) GetNoResend() bool

func (*MessageBase) GetOrigin

func (m *MessageBase) GetOrigin() int

func (*MessageBase) GetResendCnt

func (m *MessageBase) GetResendCnt() int

func (*MessageBase) GetVMHash

func (m *MessageBase) GetVMHash() []byte

func (*MessageBase) GetVMIndex

func (m *MessageBase) GetVMIndex() (index int)

func (*MessageBase) InvalidateSignatures

func (m *MessageBase) InvalidateSignatures()

func (*MessageBase) IsFullBroadcast

func (m *MessageBase) IsFullBroadcast() bool

func (*MessageBase) IsLocal

func (m *MessageBase) IsLocal() bool

func (*MessageBase) IsNetwork

func (m *MessageBase) IsNetwork() bool

func (*MessageBase) IsPeer2Peer

func (m *MessageBase) IsPeer2Peer() bool

Returns true if this is a response to a peer to peer request.

func (*MessageBase) IsStalled

func (m *MessageBase) IsStalled() bool

func (*MessageBase) IsValid

func (m *MessageBase) IsValid() bool

func (*MessageBase) MarkSentInvalid

func (m *MessageBase) MarkSentInvalid(b bool)

To suppress how many messages are sent to the NetworkInvalid Queue, we mark them, and only send them once.

func (*MessageBase) SendOut

func (m *MessageBase) SendOut(s interfaces.IState, msg interfaces.IMsg)

func (*MessageBase) SentInvalid

func (m *MessageBase) SentInvalid() bool

func (*MessageBase) SetFullBroadcast

func (m *MessageBase) SetFullBroadcast(v bool)

func (*MessageBase) SetFullMsgHash

func (m *MessageBase) SetFullMsgHash(hash interfaces.IHash)

func (*MessageBase) SetLeaderChainID

func (m *MessageBase) SetLeaderChainID(hash interfaces.IHash)

func (*MessageBase) SetLocal

func (m *MessageBase) SetLocal(v bool)

func (*MessageBase) SetMinute

func (m *MessageBase) SetMinute(minute byte)

func (*MessageBase) SetNetwork

func (m *MessageBase) SetNetwork(v bool)

func (*MessageBase) SetNetworkOrigin

func (m *MessageBase) SetNetworkOrigin(o string)

func (*MessageBase) SetNoResend

func (m *MessageBase) SetNoResend(v bool)

func (*MessageBase) SetOrigin

func (m *MessageBase) SetOrigin(o int)

func (*MessageBase) SetPeer2Peer

func (m *MessageBase) SetPeer2Peer(f bool)

func (*MessageBase) SetStall

func (m *MessageBase) SetStall(b bool)

func (*MessageBase) SetVMHash

func (m *MessageBase) SetVMHash(vmhash []byte)

func (*MessageBase) SetVMIndex

func (m *MessageBase) SetVMIndex(index int)

func (*MessageBase) SetValid

func (m *MessageBase) SetValid()

func (*MessageBase) StringOfMsgBase

func (m *MessageBase) StringOfMsgBase() string

Jump to

Keyboard shortcuts

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