Config is a descriptor which specifies the blockchain instance configuration.

Config is referenced in 2 repositories



	// TimeSource defines the median time source to use for things such as
	// block processing and determining whether or not the chain is current.
	// The caller is expected to keep a reference to the time source as well
	// and add time samples from other peers on the network so the local
	// time is adjusted to be in agreement with other peers.
	TimeSource MedianTimeSource

	// Notifications defines a callback to which notifications will be sent
	// when various events take place.  See the documentation for
	// Notification and NotificationType for details on the types and
	// contents of notifications.
	// This field can be nil if the caller is not interested in receiving
	// notifications.
	Notifications NotificationCallback

	// SigCache defines a signature cache to use when when validating
	// signatures.  This is typically most useful when individual
	// transactions are already being validated prior to their inclusion in
	// a block such as what is usually done via a transaction memory pool.
	// This field can be nil if the caller is not interested in using a
	// signature cache.
	SigCache *txscript.SigCache

	// IndexManager defines an index manager to use when initializing the
	// chain and connecting and disconnecting blocks.
	// This field can be nil if the caller does not wish to make use of an
	// index manager.
	IndexManager IndexManager

// New returns a BlockChain instance using the provided configuration details.
func New(config *Config) (*BlockChain, error) {
	// Enforce required config fields.
	if config.DB == nil {
		return nil, AssertError("blockchain.New database is nil")
	if config.ChainParams == nil {
		return nil, AssertError("blockchain.New chain parameters nil")

	// Generate a checkpoint by height map from the provided checkpoints.
	params := config.ChainParams