Documentation ¶
Index ¶
- Constants
- Variables
- func AddressVerPubKey(isTest bool) byte
- func AddressVerScript(isTest bool) byte
- func Hash160ToAddressStr(hash160 []byte, version byte) (str string, err error)
- func ReadScript(reader io.Reader, pver uint32, maxAllowed uint32, fieldName string) (signScript []byte, err error)
- type Address
- type Block
- type BlockChain
- func (blockChain *BlockChain) BestBlockHash() (utils.Hash, int32, error)
- func (blockChain *BlockChain) FetchNextBlock() (raw []byte, err error)
- func (blockChain *BlockChain) NextBlock() (block *Block, err error)
- func (blockChain *BlockChain) SkipBlock() (err error)
- func (blockChain *BlockChain) SkipTo(blkID uint32, offset int64) (err error)
- type Checkpoint
- type OutPoint
- type ScriptFreeList
- type Tx
- type TxIn
- type TxOut
Constants ¶
View Source
const ( AddressBytesLength = 25 Hash160BytesLength = 20 PublicKeyToAddressInTest = 111 PublicKeyToAddress = 0 ScriptToAddressInTest = 196 ScriptToAddress = 5 )
View Source
const ( MaxTxInSequenceNum uint32 = 0xffffffff FreeListMaxItems = 12500 MaxMessagePayload = 32 * 1024 * 1024 MinTxInPayload = 9 + utils.HashSize MaxTxInPerMessage = (MaxMessagePayload / MinTxInPayload) + 1 )
Variables ¶
View Source
var EmptyByte = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Functions ¶
func AddressVerPubKey ¶
func AddressVerScript ¶
func Hash160ToAddressStr ¶
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func AddressFromHash160 ¶
func AddressFromPublicKey ¶
func AddressFromString ¶
type Block ¶
type Block struct { Raw []byte Hash utils.Hash Height int32 Transactions []*Tx Version uint32 MerkleRoot string BlockTime time.Time Bits uint32 Nonce uint32 Size uint32 TotalBTC uint64 BlockReward float64 PrevBlock string NextBlock string }
func ParseBlock ¶
type BlockChain ¶
type BlockChain struct { Path string Magic [4]byte CurrentFile *os.File CurrentID uint32 LastBlock *Block Lock sync.Mutex }
func ParseBlockchain ¶
func ParseBlockchain(path string, magic [4]byte) (blockchain *BlockChain, err error)
func (*BlockChain) BestBlockHash ¶
func (blockChain *BlockChain) BestBlockHash() (utils.Hash, int32, error)
func (*BlockChain) FetchNextBlock ¶
func (blockChain *BlockChain) FetchNextBlock() (raw []byte, err error)
func (*BlockChain) NextBlock ¶
func (blockChain *BlockChain) NextBlock() (block *Block, err error)
func (*BlockChain) SkipBlock ¶
func (blockChain *BlockChain) SkipBlock() (err error)
type Checkpoint ¶
type OutPoint ¶
func (*OutPoint) ReadOutPoint ¶
type ScriptFreeList ¶
type ScriptFreeList chan []byte
func (ScriptFreeList) Borrow ¶
func (scriptFreeList ScriptFreeList) Borrow(size uint64) []byte
func (ScriptFreeList) Return ¶
func (scriptFreeList ScriptFreeList) Return(buf []byte)
type Tx ¶
func (*Tx) SerializeSize ¶
Click to show internal directories.
Click to hide internal directories.