mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-03-02 06:47:27 +08:00
fix rpc bug
This commit is contained in:
parent
80be91d067
commit
32ed742489
@ -840,6 +840,10 @@ func (e *TokenExecutionEngine) GetRingPosition() int {
|
||||
}
|
||||
|
||||
tries := e.clock.GetFrameProverTries()
|
||||
if len(tries) <= 1 {
|
||||
return -1
|
||||
}
|
||||
|
||||
for i, trie := range tries[1:] {
|
||||
if trie.Contains(altAddr.FillBytes(make([]byte, 32))) {
|
||||
return i
|
||||
|
||||
@ -166,9 +166,15 @@ func (r *RPCServer) GetNodeInfo(
|
||||
if head != nil {
|
||||
frame = head.FrameNumber
|
||||
}
|
||||
seniority := r.executionEngines[0].GetSeniority()
|
||||
ring := r.executionEngines[0].GetRingPosition()
|
||||
|
||||
var seniority *big.Int
|
||||
ring := -1
|
||||
if frame > 0 {
|
||||
seniority = r.executionEngines[0].GetSeniority()
|
||||
ring = r.executionEngines[0].GetRingPosition()
|
||||
}
|
||||
if seniority == nil {
|
||||
seniority = big.NewInt(0)
|
||||
}
|
||||
return &protobufs.NodeInfoResponse{
|
||||
PeerId: peerID.String(),
|
||||
MaxFrame: frame,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user