24 lines
844 B
Go
24 lines
844 B
Go
// Copyright (c) 2020 The Decred developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package netsync
|
|
|
|
import (
|
|
"github.com/decred/dcrd/chaincfg/chainhash"
|
|
"github.com/decred/dcrd/dcrutil/v4"
|
|
"github.com/decred/dcrd/peer/v2"
|
|
)
|
|
|
|
// PeerNotifier provides an interface to notify peers of status changes related
|
|
// to blocks and transactions.
|
|
type PeerNotifier interface {
|
|
// AnnounceNewTransactions generates and relays inventory vectors and
|
|
// notifies websocket clients of the passed transactions.
|
|
AnnounceNewTransactions(txns []*dcrutil.Tx)
|
|
|
|
// UpdatePeerHeights updates the heights of all peers who have announced the
|
|
// latest connected main chain block, or a recognized orphan.
|
|
UpdatePeerHeights(latestBlkHash *chainhash.Hash, latestHeight int64, updateSource *peer.Peer)
|
|
}
|