mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 00:25:17 +00:00
QOL – stop spamming peer list, fix crazy VDF edge case
This commit is contained in:
parent
e4d9bcdbf0
commit
5f9c90f284
@ -48,6 +48,9 @@ func NewClassGroupFromBytesDiscriminant(buf []byte, discriminant *big.Int) (*Cla
|
|||||||
|
|
||||||
a := decodeTwosComplement(buf[:int_size])
|
a := decodeTwosComplement(buf[:int_size])
|
||||||
b := decodeTwosComplement(buf[int_size:])
|
b := decodeTwosComplement(buf[int_size:])
|
||||||
|
if a.Cmp(big.NewInt(0)) == 0 {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
return NewClassGroupFromAbDiscriminant(a, b, discriminant), true
|
return NewClassGroupFromAbDiscriminant(a, b, discriminant), true
|
||||||
}
|
}
|
||||||
@ -546,6 +549,9 @@ func SolveMod(a, b, m *big.Int) (s, t *big.Int, solvable bool) {
|
|||||||
//e := big.NewInt(0)
|
//e := big.NewInt(0)
|
||||||
//g := new(big.Int).GCD(d, e, a, m)
|
//g := new(big.Int).GCD(d, e, a, m)
|
||||||
g, d, _ := extendedGCD(a, m)
|
g, d, _ := extendedGCD(a, m)
|
||||||
|
if g.Cmp(big.NewInt(0)) == 0 {
|
||||||
|
return nil, nil, false
|
||||||
|
}
|
||||||
|
|
||||||
//q, r = divmod(b, g)
|
//q, r = divmod(b, g)
|
||||||
r := big.NewInt(1)
|
r := big.NewInt(1)
|
||||||
|
@ -177,10 +177,6 @@ func (e *MasterClockConsensusEngine) Start() <-chan error {
|
|||||||
zap.Int("peer_store_count", e.pubSub.GetPeerstoreCount()),
|
zap.Int("peer_store_count", e.pubSub.GetPeerstoreCount()),
|
||||||
zap.Int("network_peer_count", e.pubSub.GetNetworkPeersCount()),
|
zap.Int("network_peer_count", e.pubSub.GetNetworkPeersCount()),
|
||||||
)
|
)
|
||||||
e.logger.Info(
|
|
||||||
"peers by bitmask",
|
|
||||||
zap.Any("peers", e.pubSub.GetBitmaskPeers()),
|
|
||||||
)
|
|
||||||
time.Sleep(10 * time.Second)
|
time.Sleep(10 * time.Second)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user