Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Nonce uint64 UUID uint64 Height int32 PrevBlock chainhash.Hash Bits Diffs Merkles Merkles Timestamp time.Time // contains filtered or unexported fields }
Message describes a message that a mining worker can use to construct a block to mine on, as well the extra data required to reconstruct any version block mined by the miner
func DeserializeMsgBlockTemplate ¶
DeserializeMsgBlockTemplate takes a message expected to be a Message and reconstitutes it
func (*Message) GenBlockHeader ¶
func (m *Message) GenBlockHeader(vers int32) *wire.BlockHeader
GenBlockHeader generate a block given a version number to use for mining The nonce is empty, date can be updated, version changes merkle and target bits. All the data required for this is in the exported fields that are serialized for over the wire
func (*Message) Reconstruct ¶
Reconstruct takes a received block from the wire and reattaches the transactions
type RecentMessages ¶
type RecentMessages struct {
// contains filtered or unexported fields
}
RecentMessages keeps a buffer of four previously created messages so that solutions found after a new template is created can be submitted
func NewRecentMessages ¶
func NewRecentMessages() *RecentMessages
func (*RecentMessages) Add ¶
func (rm *RecentMessages) Add(msg *Message)
Add a message to the RecentMessages, we just write to the current cursor position, and then advance it, back to zero if it exceeds the buffer length, overwriting the first, and so on
func (*RecentMessages) Find ¶
func (rm *RecentMessages) Find(nonce uint64) *Message
Find checks whether the given nonce matches any of the cached Message's and remove it from the list
func (*RecentMessages) Len ¶
func (rm *RecentMessages) Len() (o int)
Len returns the number of elements in the buffer