Documentation ¶
Index ¶
- func GetBaseReward(alreadyGeneratedCounts uint64) uint64
- func GetBlockReward(medianWeight, currentBlockWeight, alreadyGeneratedCoins uint64, version uint8) (reward uint64)
- type Block
- func (b *Block) AppendBinaryFlags(preAllocatedBuf []byte, compact, pruned, containsAuxiliaryTemplateId bool) (buf []byte, err error)
- func (b *Block) BufferLength() int
- func (b *Block) Difficulty(f GetDifficultyByHeightFunc) types.Difficulty
- func (b *Block) FromCompactReader(reader utils.ReaderAndByteReader, canBePruned bool, f PrunedFlagsFunc) (err error)
- func (b *Block) FromReader(reader utils.ReaderAndByteReader, canBePruned bool, f PrunedFlagsFunc) (err error)
- func (b *Block) FromReaderFlags(reader utils.ReaderAndByteReader, compact, canBePruned bool, f PrunedFlagsFunc) (err error)
- func (b *Block) HashingBlob(preAllocatedBuf []byte) []byte
- func (b *Block) HashingBlobBufferLength() int
- func (b *Block) Header() *Header
- func (b *Block) HeaderBlob(preAllocatedBuf []byte) []byte
- func (b *Block) HeaderBlobBufferLength() int
- func (b *Block) Id() types.Hash
- func (b *Block) MarshalBinary() (buf []byte, err error)
- func (b *Block) MarshalBinaryFlags(compact, pruned, containsAuxiliaryTemplateId bool) (buf []byte, err error)
- func (b *Block) PowHashWithError(hasher randomx.Hasher, f GetSeedByHeightFunc) (types.Hash, error)
- func (b *Block) SideChainHashingBlob(preAllocatedBuf []byte, zeroTemplateId bool) (buf []byte, err error)
- func (b *Block) UnmarshalBinary(data []byte, canBePruned bool, f PrunedFlagsFunc) error
- type GetBlockHeaderByHashFunc
- type GetBlockHeaderByHeightFunc
- type GetDifficultyByHeightFunc
- type GetSeedByHeightFunc
- type Header
- type PrunedFlagsFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBaseReward ¶
func GetBlockReward ¶
func GetBlockReward(medianWeight, currentBlockWeight, alreadyGeneratedCoins uint64, version uint8) (reward uint64)
GetBlockReward Taken from https://github.com/monero-project/monero/blob/b0bf49a65a38ceb1acfbc8e17f40e63383ac140d/src/cryptonote_basic/cryptonote_basic_impl.cpp#L83
Types ¶
type Block ¶
type Block struct { MajorVersion uint8 `json:"major_version"` MinorVersion uint8 `json:"minor_version"` // Nonce re-arranged here to improve memory layout space Nonce uint32 `json:"nonce"` Timestamp uint64 `json:"timestamp"` PreviousId types.Hash `json:"previous_id"` Coinbase transaction.CoinbaseTransaction `json:"coinbase"` Transactions []types.Hash `json:"transactions,omitempty"` // TransactionParentIndices amount of reward existing Outputs. Used by p2pool serialized compact broadcasted blocks in protocol >= 1.1, filled only in compact blocks or by pre-processing. TransactionParentIndices []uint64 `json:"transaction_parent_indices,omitempty"` }
func (*Block) AppendBinaryFlags ¶
func (*Block) BufferLength ¶
func (*Block) Difficulty ¶
func (b *Block) Difficulty(f GetDifficultyByHeightFunc) types.Difficulty
func (*Block) FromCompactReader ¶
func (b *Block) FromCompactReader(reader utils.ReaderAndByteReader, canBePruned bool, f PrunedFlagsFunc) (err error)
func (*Block) FromReader ¶
func (b *Block) FromReader(reader utils.ReaderAndByteReader, canBePruned bool, f PrunedFlagsFunc) (err error)
func (*Block) FromReaderFlags ¶
func (b *Block) FromReaderFlags(reader utils.ReaderAndByteReader, compact, canBePruned bool, f PrunedFlagsFunc) (err error)
func (*Block) HashingBlob ¶
func (*Block) HashingBlobBufferLength ¶
func (*Block) HeaderBlob ¶
func (*Block) HeaderBlobBufferLength ¶
func (*Block) MarshalBinary ¶
func (*Block) MarshalBinaryFlags ¶
func (*Block) PowHashWithError ¶
func (*Block) SideChainHashingBlob ¶
func (b *Block) SideChainHashingBlob(preAllocatedBuf []byte, zeroTemplateId bool) (buf []byte, err error)
SideChainHashingBlob Same as MarshalBinary but with nonce or template id set to 0
func (*Block) UnmarshalBinary ¶
func (b *Block) UnmarshalBinary(data []byte, canBePruned bool, f PrunedFlagsFunc) error
type GetDifficultyByHeightFunc ¶
type GetDifficultyByHeightFunc func(height uint64) types.Difficulty
type GetSeedByHeightFunc ¶
type Header ¶
type Header struct { MajorVersion uint8 `json:"major_version"` MinorVersion uint8 `json:"minor_version"` // Nonce re-arranged here to improve memory layout space Nonce uint32 `json:"nonce"` Timestamp uint64 `json:"timestamp"` PreviousId types.Hash `json:"previous_id"` Height uint64 `json:"height"` //Nonce would be here Reward uint64 `json:"reward"` Difficulty types.Difficulty `json:"difficulty"` Id types.Hash `json:"id"` }
type PrunedFlagsFunc ¶ added in v3.4.0
type PrunedFlagsFunc func() (containsAuxiliaryTemplateId bool)
Click to show internal directories.
Click to hide internal directories.