QOL – stop spamming peer list, fix crazy VDF edge case

This commit is contained in:
Cassandra Heart 2023-09-24 23:12:05 -05:00
parent e4d9bcdbf0
commit 5f9c90f284
No known key found for this signature in database
GPG Key ID: 6352152859385958
2 changed files with 15 additions and 13 deletions

View File

@ -48,6 +48,9 @@ func NewClassGroupFromBytesDiscriminant(buf []byte, discriminant *big.Int) (*Cla
a := 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
}
@ -546,6 +549,9 @@ func SolveMod(a, b, m *big.Int) (s, t *big.Int, solvable bool) {
//e := big.NewInt(0)
//g := new(big.Int).GCD(d, e, a, m)
g, d, _ := extendedGCD(a, m)
if g.Cmp(big.NewInt(0)) == 0 {
return nil, nil, false
}
//q, r = divmod(b, g)
r := big.NewInt(1)

View File

@ -177,10 +177,6 @@ func (e *MasterClockConsensusEngine) Start() <-chan error {
zap.Int("peer_store_count", e.pubSub.GetPeerstoreCount()),
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)
}
}()