2017-08-24 22:33:51 +02:00
|
|
|
// Copyright (c) 2017 The btcsuite developers
|
|
|
|
// Use of this source code is governed by an ISC
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package netsync
|
|
|
|
|
|
|
|
import (
|
2021-10-15 07:45:32 +02:00
|
|
|
"github.com/lbryio/lbcd/blockchain"
|
|
|
|
"github.com/lbryio/lbcd/chaincfg"
|
|
|
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
|
|
|
"github.com/lbryio/lbcd/mempool"
|
|
|
|
"github.com/lbryio/lbcd/peer"
|
|
|
|
"github.com/lbryio/lbcd/wire"
|
|
|
|
btcutil "github.com/lbryio/lbcutil"
|
2017-08-24 22:33:51 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// PeerNotifier exposes methods to notify peers of status changes to
|
|
|
|
// transactions, blocks, etc. Currently server (in the main package) implements
|
|
|
|
// this interface.
|
|
|
|
type PeerNotifier interface {
|
|
|
|
AnnounceNewTransactions(newTxs []*mempool.TxDesc)
|
|
|
|
|
|
|
|
UpdatePeerHeights(latestBlkHash *chainhash.Hash, latestHeight int32, updateSource *peer.Peer)
|
|
|
|
|
|
|
|
RelayInventory(invVect *wire.InvVect, data interface{})
|
|
|
|
|
|
|
|
TransactionConfirmed(tx *btcutil.Tx)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Config is a configuration struct used to initialize a new SyncManager.
|
|
|
|
type Config struct {
|
|
|
|
PeerNotifier PeerNotifier
|
|
|
|
Chain *blockchain.BlockChain
|
|
|
|
TxMemPool *mempool.TxPool
|
|
|
|
ChainParams *chaincfg.Params
|
|
|
|
|
|
|
|
DisableCheckpoints bool
|
|
|
|
MaxPeers int
|
2017-11-14 05:37:35 +01:00
|
|
|
|
|
|
|
FeeEstimator *mempool.FeeEstimator
|
2017-08-24 22:33:51 +02:00
|
|
|
}
|