Documentation
¶
Index ¶
- Constants
- Variables
- func Broadcast(data []byte, excludeNeighbor *server.Neighbor) int
- func End()
- func GetMilestoneKeyByIndex(index int, acceptNearest bool) []byte
- func GetTXToApprove(reference []byte, depth int) ([][]byte, error)
- func LoadMissingMilestonesFromFile(path string) error
- func Report()
- func SaveTX(tx *transaction.FastTX, raw *[]byte, dbTx db.Transaction) (e error)
- func Start()
- type GraphNode
- type GraphRating
- type IncomingTX
- type Message
- type Milestone
- type PendingConfirmation
- type PendingMilestone
- type PendingRequest
- type Request
- type RequestQueue
Constants ¶
View Source
const ( P_TIP_REPLY = 25 P_BROADCAST = 10 )
View Source
const ( COO_ADDRESS = "KPWCHICGJZXKE9GSUDXZYUAPLHAKAHYHDXNPHENTERYMMBQOPSQIDENXKLKCEYCPVTZQLEEJVYJZV9BWU" COO_ADDRESS2 = "999999999999999999999999999999999999999999999999999999999999999999999999999999999" )
View Source
const ( MWM = 14 TRYTES_SIZE = 2673 PACKET_SIZE = 1650 REQ_HASH_SIZE = 46 HASH_SIZE = 49 // This is not "46" on purpose, because all hashes in the DB are stored with length 49 DATA_SIZE = PACKET_SIZE - REQ_HASH_SIZE TX_TRITS_LENGTH = 8019 )
View Source
const ( MinTipselDepth = 3 MaxTipselDepth = 7 MaxCheckDepth = 70 MaxTipAge = MaxTipselDepth * time.Duration(40) * time.Second MaxTXAge = time.Duration(60) * time.Second )
View Source
const (
UNKNOWN_CHECK_INTERVAL = time.Duration(60) * time.Second
)
Variables ¶
View Source
var ( COO_ADDRESS_BYTES = convert.TrytesToBytes(COO_ADDRESS)[:49] COO_ADDRESS2_BYTES = convert.TrytesToBytes(COO_ADDRESS2)[:49] LatestMilestone Milestone // TODO: Access latest milestone only via GetLatestMilestone() LatestMilestoneLock = &sync.RWMutex{} )
View Source
var ( PendingRequests map[string]*PendingRequest PendingRequestsLock = &sync.RWMutex{} )
View Source
var ( LastIncomingTime map[string]time.Time LastIncomingTimeLock = &sync.RWMutex{} RequestQueues map[string]*RequestQueue RequestQueuesLock = &sync.RWMutex{} )
Functions ¶
func GetMilestoneKeyByIndex ¶
* Returns the (hash) key for a specific milestone. if acceptNearest is set, the nearest, more recent milestone is returned, if the other is not found.
func LoadMissingMilestonesFromFile ¶
TODO: remove this? Or add an API interface?
func SaveTX ¶
func SaveTX(tx *transaction.FastTX, raw *[]byte, dbTx db.Transaction) (e error)
Types ¶
type GraphRating ¶
type IncomingTX ¶
type IncomingTX struct {
TX *transaction.FastTX
Neighbor *server.Neighbor
Bytes *[]byte
}
type Milestone ¶
type Milestone struct {
TX *transaction.FastTX
Index int
}
func GetLatestMilestone ¶
func GetLatestMilestone() *Milestone
type PendingConfirmation ¶
type PendingConfirmation struct {
// contains filtered or unexported fields
}
type PendingMilestone ¶
type PendingRequest ¶
type RequestQueue ¶
type RequestQueue chan *Request
Click to show internal directories.
Click to hide internal directories.