mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-25 08:05:17 +00:00
also refer to adjusted balance for rpc
This commit is contained in:
parent
8899ccd864
commit
d02ef18174
@ -226,6 +226,12 @@ func (r *RPCServer) GetTokenInfo(
|
|||||||
return nil, errors.Wrap(err, "get token info")
|
return nil, errors.Wrap(err, "get token info")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
peerBytes := r.pubSub.GetPeerID()
|
||||||
|
peerAddr, err := poseidon.HashBytes(peerBytes)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
addr, err := poseidon.HashBytes(provingKey.PublicKey)
|
addr, err := poseidon.HashBytes(provingKey.PublicKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -234,6 +240,9 @@ func (r *RPCServer) GetTokenInfo(
|
|||||||
addrBytes := addr.Bytes()
|
addrBytes := addr.Bytes()
|
||||||
addrBytes = append(make([]byte, 32-len(addrBytes)), addrBytes...)
|
addrBytes = append(make([]byte, 32-len(addrBytes)), addrBytes...)
|
||||||
|
|
||||||
|
peerAddrBytes := peerAddr.Bytes()
|
||||||
|
peerAddrBytes = append(make([]byte, 32-len(peerAddrBytes)), peerAddrBytes...)
|
||||||
|
|
||||||
frame, err := r.clockStore.GetLatestDataClockFrame(
|
frame, err := r.clockStore.GetLatestDataClockFrame(
|
||||||
append(
|
append(
|
||||||
p2p.GetBloomFilter(application.CEREMONY_ADDRESS, 256, 3),
|
p2p.GetBloomFilter(application.CEREMONY_ADDRESS, 256, 3),
|
||||||
@ -303,6 +312,15 @@ func (r *RPCServer) GetTokenInfo(
|
|||||||
new(big.Int).SetUint64(child.External.Total),
|
new(big.Int).SetUint64(child.External.Total),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if bytes.Equal(
|
||||||
|
child.External.Key,
|
||||||
|
peerAddrBytes,
|
||||||
|
) {
|
||||||
|
ownedTotal = ownedTotal.Add(
|
||||||
|
ownedTotal,
|
||||||
|
new(big.Int).SetUint64(child.External.Total),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user