Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBTCClientNotInitialized is thrown when trying to call a non-initialized BTCClient. ErrBTCClientNotInitialized = fmt.Errorf("the btcClient has not been initialized") )
Functions ¶
func HashMerkleBranches ¶
HashMerkleBranches takes two hashes, treated as the left and right tree nodes, and returns the hash of their concatenation. This is a helper function used to aid in the generation of a merkle tree.
Types ¶
type BTCClient ¶
type BTCClient struct {
// contains filtered or unexported fields
}
BTCClient implements a wrapped Go client for retrieving information of the BTC network.
func NewBTCMainNetClient ¶
NewBTCMainNetClient returns a BTC main-net client.
func NewBTCTestNetClient ¶
NewBTCTestNetClient returns a BTC test-net client.
func (*BTCClient) BuildMsgTxFromCypher ¶
BuildMsgTxFromCypher returns a wire.MsgTx given a BTC transaction hash.
func (*BTCClient) BuildProof ¶
BuildProof constructs the proof for a BTC transaction hash.
type BTCProof ¶
type BTCProof struct { MerkleProofs []*MerkleProof BTCTx *wire.MsgTx BlockHash *chainhash.Hash }
BTCProof represents a Merkle proof for a BTC transaction.
type MerkleProof ¶
MerkleProof represents a Merkle path.
func BuildMerkleProof ¶
func BuildMerkleProof(txHashes []*chainhash.Hash, targetedTxHash *chainhash.Hash) []*MerkleProof
BuildMerkleProof returns a list of MerkleProof of a transaction hash.