Add `honey_badger` getter for `DynamicHoneyBadger`

This commit is contained in:
C.Solovev 2019-02-25 15:42:41 +04:00 committed by Andreas Fackler
parent 5b86543bbf
commit 0e7edb2be7
2 changed files with 6 additions and 1 deletions

View File

@ -230,6 +230,11 @@ where
&self.netinfo
}
/// Returns a reference to the internal managed `HoneyBadger` instance.
pub fn honey_badger(&self) -> &HoneyBadger<InternalContrib<C, N>, N> {
&self.honey_badger
}
/// Returns `true` if we should make our contribution for the next epoch, even if we don't have
/// content ourselves, to avoid stalling the network.
///

View File

@ -196,7 +196,7 @@ impl<N: NodeIdT> KeyGenState<N> {
/// The contribution for the internal `HoneyBadger` instance: this includes a user-defined
/// application-level contribution as well as internal signed messages.
#[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize, Hash)]
struct InternalContrib<C, N: Ord> {
pub struct InternalContrib<C, N: Ord> {
/// A user-defined contribution.
contrib: C,
/// Key generation messages that get committed via Honey Badger to communicate synchronously.