Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callbacks ¶ added in v1.6.0
type Callbacks struct { Synced func(synced bool) FetchMissingCFiltersStarted func() FetchMissingCFiltersProgress func(startCFiltersHeight, endCFiltersHeight int32) FetchMissingCFiltersFinished func() FetchHeadersStarted func() FetchHeadersProgress func(lastHeaderHeight int32, lastHeaderTime int64) FetchHeadersFinished func() DiscoverAddressesStarted func() DiscoverAddressesFinished func() RescanStarted func() RescanProgress func(rescannedThrough int32) RescanFinished func() }
Callbacks contains optional callback functions to notify events during the syncing process. All callbacks are called synchronously and block the syncer from continuing.
type RPCOptions ¶ added in v1.6.0
type RPCOptions struct { Address string DefaultPort string User string Pass string Dial func(ctx context.Context, network, address string) (net.Conn, error) CA []byte Insecure bool }
RPCOptions specifies the network and security settings for establishing a websocket connection to a dcrd JSON-RPC server.
type Syncer ¶ added in v1.6.0
type Syncer struct {
// contains filtered or unexported fields
}
Syncer implements wallet synchronization services by processing notifications from a dcrd JSON-RPC server.
func NewSyncer ¶ added in v1.6.0
func NewSyncer(w *wallet.Wallet, r *RPCOptions) *Syncer
NewSyncer creates a Syncer that will sync the wallet using dcrd JSON-RPC.
func (*Syncer) Run ¶ added in v1.6.0
Run synchronizes the wallet, returning when synchronization fails or the context is cancelled. If startupSync is true, all synchronization tasks needed to fully register the wallet for notifications and synchronize it with the dcrd server are performed. Otherwise, it will listen for notifications but not register for any updates.
func (*Syncer) SetCallbacks ¶ added in v1.6.0
SetCallbacks sets the possible various callbacks that are used to notify interested parties to the syncing progress.