-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #855 from iotaledger/feat/wallclock-drift
Make sure user knows that block was filtered out due to wallclock drift
- Loading branch information
Showing
5 changed files
with
67 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
package protocol | ||
|
||
import "github.com/iotaledger/iota-core/pkg/protocol/engine" | ||
import ( | ||
"github.com/libp2p/go-libp2p/core/peer" | ||
|
||
"github.com/iotaledger/hive.go/runtime/event" | ||
"github.com/iotaledger/iota-core/pkg/model" | ||
"github.com/iotaledger/iota-core/pkg/protocol/engine" | ||
) | ||
|
||
// Events exposes the Events of the main engine of the protocol at a single endpoint. | ||
// | ||
// TODO: It should be replaced with reactive calls to the corresponding events and be deleted but we can do this in a | ||
// later PR (to minimize the code changes to review). | ||
type Events struct { | ||
Engine *engine.Events | ||
Engine *engine.Events | ||
ProtocolFilter *event.Event1[*BlockFilteredEvent] | ||
} | ||
|
||
// NewEvents creates a new Events instance. | ||
func NewEvents() *Events { | ||
return &Events{ | ||
Engine: engine.NewEvents(), | ||
Engine: engine.NewEvents(), | ||
ProtocolFilter: event.New1[*BlockFilteredEvent](), | ||
} | ||
} | ||
|
||
type BlockFilteredEvent struct { | ||
Block *model.Block | ||
Reason error | ||
Source peer.ID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters