Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MainGenesisBlockBytes, _ = hex.DecodeString("0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c")
TestGenesisBlockBytes, _ = hex.DecodeString("0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff001d1aa4ae18")
)
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Version uint32 // Block version, based on the software version creating this block. PrevBlock [32]byte // The hash value of the previous block this particular block references. MerkleRoot [32]byte // Merkle tree hash of all transactions related to this block. Timestamp uint32 // A timestamp recording when this block was created (limited to 2106). Bits [4]byte // The calculated difficulty target being used for this block. Nonce [4]byte // The nonce used to generate this block. }
Block represents a Bitcoin block header, the metadata of a block.
func (*Block) Difficulty ¶
Difficulty returns the block (current mining) difficulty based on the bits. Difficulty is simply a human interpretable form of the target. The difficulty of the genesis block is 1. The formula is as follows:
difficulty = (target of lowest difficulty) / (current target)
Click to show internal directories.
Click to hide internal directories.