Documentation ¶
Index ¶
- type NeutrinoClient
- func (s *NeutrinoClient) BackEnd() string
- func (s *NeutrinoClient) BlockStamp() (*waddrmgr.BlockStamp, error)
- func (s *NeutrinoClient) FilterBlocks(req *chain.FilterBlocksRequest) (*chain.FilterBlocksResponse, error)
- func (s *NeutrinoClient) GetBestBlock() (*chainhash.Hash, int32, error)
- func (s *NeutrinoClient) GetBlock(hash *chainhash.Hash) (*wire.MsgBlock, error)
- func (s *NeutrinoClient) GetBlockHash(height int64) (*chainhash.Hash, error)
- func (s *NeutrinoClient) GetBlockHeader(blockHash *chainhash.Hash) (*wire.BlockHeader, error)
- func (s *NeutrinoClient) GetBlockHeight(hash *chainhash.Hash) (int32, error)
- func (s *NeutrinoClient) IsCurrent() bool
- func (s *NeutrinoClient) Notifications() <-chan interface{}
- func (s *NeutrinoClient) NotifyBlocks() error
- func (s *NeutrinoClient) NotifyReceived(addrs []bchutil.Address) error
- func (s *NeutrinoClient) Rescan(startHash *chainhash.Hash, addrs []bchutil.Address, ...) error
- func (s *NeutrinoClient) SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error)
- func (s *NeutrinoClient) SetStartTime(startTime time.Time)
- func (s *NeutrinoClient) Start() error
- func (s *NeutrinoClient) Stop()
- func (s *NeutrinoClient) WaitForShutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NeutrinoClient ¶
type NeutrinoClient struct { CS *neutrino.ChainService // contains filtered or unexported fields }
NeutrinoClient is an implementation of the bchwalet chain.Interface interface.
func NewNeutrinoClient ¶
func NewNeutrinoClient(chainParams *chaincfg.Params, chainService *neutrino.ChainService, log bchlog.Logger) *NeutrinoClient
NewNeutrinoClient creates a new NeutrinoClient struct with a backing ChainService.
func (*NeutrinoClient) BackEnd ¶
func (s *NeutrinoClient) BackEnd() string
BackEnd returns the name of the driver.
func (*NeutrinoClient) BlockStamp ¶
func (s *NeutrinoClient) BlockStamp() (*waddrmgr.BlockStamp, error)
BlockStamp returns the latest block notified by the client, or an error if the client has been shut down.
func (*NeutrinoClient) FilterBlocks ¶
func (s *NeutrinoClient) FilterBlocks( req *chain.FilterBlocksRequest) (*chain.FilterBlocksResponse, error)
FilterBlocks scans the blocks contained in the FilterBlocksRequest for any addresses of interest. For each requested block, the corresponding compact filter will first be checked for matches, skipping those that do not report anything. If the filter returns a postive match, the full block will be fetched and filtered. This method returns a FilterBlocksReponse for the first block containing a matching address. If no matches are found in the range of blocks requested, the returned response will be nil.
func (*NeutrinoClient) GetBestBlock ¶
func (s *NeutrinoClient) GetBestBlock() (*chainhash.Hash, int32, error)
GetBestBlock replicates the RPC client's GetBestBlock command.
func (*NeutrinoClient) GetBlockHash ¶
func (s *NeutrinoClient) GetBlockHash(height int64) (*chainhash.Hash, error)
GetBlockHash returns the block hash for the given height, or an error if the client has been shut down or the hash at the block height doesn't exist or is unknown.
func (*NeutrinoClient) GetBlockHeader ¶
func (s *NeutrinoClient) GetBlockHeader( blockHash *chainhash.Hash) (*wire.BlockHeader, error)
GetBlockHeader returns the block header for the given block hash, or an error if the client has been shut down or the hash doesn't exist or is unknown.
func (*NeutrinoClient) GetBlockHeight ¶
func (s *NeutrinoClient) GetBlockHeight(hash *chainhash.Hash) (int32, error)
GetBlockHeight gets the height of a block by its hash. It serves as a replacement for the use of GetBlockVerboseTxAsync for the wallet package since we can't actually return a FutureGetBlockVerboseResult because the underlying type is private to rpcclient.
func (*NeutrinoClient) IsCurrent ¶
func (s *NeutrinoClient) IsCurrent() bool
IsCurrent returns whether the chain backend considers its view of the network as "current".
func (*NeutrinoClient) Notifications ¶
func (s *NeutrinoClient) Notifications() <-chan interface{}
Notifications replicates the RPC client's Notifications method.
func (*NeutrinoClient) NotifyBlocks ¶
func (s *NeutrinoClient) NotifyBlocks() error
NotifyBlocks replicates the RPC client's NotifyBlocks command.
func (*NeutrinoClient) NotifyReceived ¶
func (s *NeutrinoClient) NotifyReceived(addrs []bchutil.Address) error
NotifyReceived replicates the RPC client's NotifyReceived command.
func (*NeutrinoClient) Rescan ¶
func (s *NeutrinoClient) Rescan(startHash *chainhash.Hash, addrs []bchutil.Address, outPoints map[wire.OutPoint]bchutil.Address) error
Rescan replicates the RPC client's Rescan command.
func (*NeutrinoClient) SendRawTransaction ¶
func (s *NeutrinoClient) SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) ( *chainhash.Hash, error)
SendRawTransaction replicates the RPC client's SendRawTransaction command.
func (*NeutrinoClient) SetStartTime ¶
func (s *NeutrinoClient) SetStartTime(startTime time.Time)
SetStartTime is a non-interface method to set the birthday of the wallet using this object. Since only a single rescan at a time is currently supported, only one birthday needs to be set. This does not fully restart a running rescan, so should not be used to update a rescan while it is running. TODO: When factoring out to multiple rescans per Neutrino client, add a birthday per client.
func (*NeutrinoClient) Start ¶
func (s *NeutrinoClient) Start() error
Start replicates the RPC client's Start method.
func (*NeutrinoClient) Stop ¶
func (s *NeutrinoClient) Stop()
Stop replicates the RPC client's Stop method.
func (*NeutrinoClient) WaitForShutdown ¶
func (s *NeutrinoClient) WaitForShutdown()
WaitForShutdown replicates the RPC client's WaitForShutdown method.