dcrd/internal/netsync/interface.go
Dave Collins 61d1065521
netsync/server: Update peer heights directly.
Now that the sync manager is aware of all peers, this modifies it to
update their heights upon seeing the relevant announced blocks directly
instead of threading back through the server via a callback that
required a goroutine to avoid the otherwise circular lock.
2021-01-07 17:15:36 -06:00

18 lines
533 B
Go

// Copyright (c) 2020-2021 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/dcrutil/v4"
)
// 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)
}