Documentation
¶
Index ¶
Constants ¶
View Source
const ( GeecExaimeReply = 0x01 GeecElectMsg = 0x02 GeecQueryReply = 0x03 )
View Source
const ( QUERY_EMPTY = 0 QUERY_CONFIRMED = 1 QUERY_UNCONFIRMED = 2 )
View Source
const ( ELEC_Candidate = 0x01 ELEC_Voted = 0x02 ELEC_ELECTED = 0x03 )
View Source
const ( WB_PASSED = 0x00 WB_CURRENT = 0x01 WB_TIMEOUT = 0x02 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GeecMember ¶
type ProposeResult ¶
type QueryReply ¶
type QueryResult ¶
type State ¶
type State interface { Init(hc interface{}, chaindb interface{}, coninbase common.Address) error //NewTerm (start uint64, len uint64, seed uint64) error //Validate (writer p2p.MsgReadWriter, blockNum uint64) bool AppendRegReq(registratoin *types.Registratoin) Register(mux *event.TypeMux, ipstr string, portStr string, renew uint64) RecvExamineReply(reply *ValidateReply) GetWorkingBlock() *WorkingBlock RecvQueryReply(reply *QueryReply) }
type ValidateReply ¶
type ValidateRequest ¶
type WorkingBlock ¶
type WorkingBlock struct { BlkNum uint64 //PendingBlock []byte MaxVersion int64 MaxValidateRetry int64 MaxValidateVersion int64 MaxQueryRetry int64 Mu *sync.Mutex //Electing for proposer ElectState uint8 Supporters *hashset.Set MyRand uint64 Delegator common.Address NCandidates uint64 ElectionThreshold uint64 Delegator_Ipstr string Delegator_Port uint Max_Election_Retry uint64 //validating IsProposer bool ValidateReplies *hashmap.Map ValidateThreshold uint64 ValidateSucceeded bool //query QueryReplies *hashmap.Map QueryEmptyCount uint64 QueryNonEmptyCount uint64 QueryThreshold uint64 QueryRecvMajority bool //util, not changed during move R *rand.Rand Coinbase common.Address Cond *sync.Cond }
func NewWorkingBlock ¶
func NewWorkingBlock(coinbase common.Address) *WorkingBlock
func (*WorkingBlock) Move ¶
func (wb *WorkingBlock) Move(blkNum uint64)
IMPORTANT This method must be called when the lock is held.
func (*WorkingBlock) Wait ¶
func (wb *WorkingBlock) Wait(num uint64) int
Click to show internal directories.
Click to hide internal directories.