mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
fix nil deref
This commit is contained in:
parent
77c036b94b
commit
2b9c5afd54
@ -36,7 +36,7 @@ func FormatVersion(version []byte) string {
|
||||
}
|
||||
|
||||
func GetPatchNumber() byte {
|
||||
return 0x00
|
||||
return 0x01
|
||||
}
|
||||
|
||||
func GetRCNumber() byte {
|
||||
|
||||
@ -164,12 +164,13 @@ func NewTokenExecutionEngine(
|
||||
}
|
||||
}
|
||||
|
||||
if peerSeniority == nil {
|
||||
if len(peerSeniority) == 0 {
|
||||
peerSeniority, err = clockStore.GetPeerSeniorityMap(intrinsicFilter)
|
||||
if err != nil && !errors.Is(err, store.ErrNotFound) {
|
||||
panic(err)
|
||||
}
|
||||
if peerSeniority == nil {
|
||||
|
||||
if len(peerSeniority) == 0 {
|
||||
peerSeniority, err = RebuildPeerSeniority(uint(cfg.P2P.Network))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@ -977,7 +978,7 @@ func (e *TokenExecutionEngine) GetSeniority() *big.Int {
|
||||
)]
|
||||
|
||||
if !ok {
|
||||
return nil
|
||||
return big.NewInt(0)
|
||||
}
|
||||
|
||||
return sen.Priority()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user