auxpow

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuxPowChainID = 1
)

Functions

func BtcReadOutPoint

func BtcReadOutPoint(r io.Reader, op *BtcOutPoint) error

func BtcReadTxIn

func BtcReadTxIn(r io.Reader, ti *BtcTxIn) error

func BtcReadTxOut

func BtcReadTxOut(r io.Reader, to *BtcTxOut) error

func BtcWriteOutPoint

func BtcWriteOutPoint(w io.Writer, op *BtcOutPoint) error

func BtcWriteTxIn

func BtcWriteTxIn(w io.Writer, ti *BtcTxIn) error

func BtcWriteTxOut

func BtcWriteTxOut(w io.Writer, to *BtcTxOut) error

func CheckMerkleBranch

func CheckMerkleBranch(hash Uint256, merkleBranch []Uint256, index int) Uint256

func GetExpectedIndex

func GetExpectedIndex(nonce uint32, chainId, h int) int

Types

type AuxPow

type AuxPow struct {
	AuxMerkleBranch   []Uint256
	AuxMerkleIndex    int
	ParCoinbaseTx     BtcTx
	ParCoinBaseMerkle []Uint256
	ParMerkleIndex    int
	ParBlockHeader    BtcBlockHeader
	ParentHash        Uint256
}

func NewAuxPow

func NewAuxPow(AuxMerkleBranch []Uint256, AuxMerkleIndex int,
	ParCoinbaseTx BtcTx, ParCoinBaseMerkle []Uint256,
	ParMerkleIndex int, ParBlockHeader BtcBlockHeader) *AuxPow

func (*AuxPow) Check

func (ap *AuxPow) Check(hashAuxBlock Uint256, chainId int) bool

func (*AuxPow) Deserialize

func (ap *AuxPow) Deserialize(r io.Reader) error

func (*AuxPow) Serialize

func (ap *AuxPow) Serialize(w io.Writer) error

type BtcBlockHeader

type BtcBlockHeader struct {
	Version    int32
	PrevBlock  Uint256
	MerkleRoot Uint256
	Timestamp  uint32
	Bits       uint32
	Nonce      uint32
}

func (*BtcBlockHeader) Deserialize

func (bh *BtcBlockHeader) Deserialize(r io.Reader) error

func (*BtcBlockHeader) Hash

func (bh *BtcBlockHeader) Hash() Uint256

func (*BtcBlockHeader) Serialize

func (bh *BtcBlockHeader) Serialize(w io.Writer) error

type BtcOutPoint

type BtcOutPoint struct {
	Hash  Uint256
	Index uint32
}

type BtcTx

type BtcTx struct {
	Version  int32
	TxIn     []*BtcTxIn
	TxOut    []*BtcTxOut
	LockTime uint32
}

func NewBtcTx

func NewBtcTx(txIn []*BtcTxIn, txOut []*BtcTxOut) *BtcTx

func (*BtcTx) Deserialize

func (tx *BtcTx) Deserialize(r io.Reader) error

func (*BtcTx) Hash

func (tx *BtcTx) Hash() Uint256

func (*BtcTx) Serialize

func (tx *BtcTx) Serialize(w io.Writer) error

type BtcTxIn

type BtcTxIn struct {
	PreviousOutPoint BtcOutPoint
	SignatureScript  []byte
	Sequence         uint32
}

type BtcTxOut

type BtcTxOut struct {
	Value    int64
	PkScript []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL