mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-24 23:55:18 +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")
|
||||
}
|
||||
|
||||
peerBytes := r.pubSub.GetPeerID()
|
||||
peerAddr, err := poseidon.HashBytes(peerBytes)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
addr, err := poseidon.HashBytes(provingKey.PublicKey)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@ -234,6 +240,9 @@ func (r *RPCServer) GetTokenInfo(
|
||||
addrBytes := addr.Bytes()
|
||||
addrBytes = append(make([]byte, 32-len(addrBytes)), addrBytes...)
|
||||
|
||||
peerAddrBytes := peerAddr.Bytes()
|
||||
peerAddrBytes = append(make([]byte, 32-len(peerAddrBytes)), peerAddrBytes...)
|
||||
|
||||
frame, err := r.clockStore.GetLatestDataClockFrame(
|
||||
append(
|
||||
p2p.GetBloomFilter(application.CEREMONY_ADDRESS, 256, 3),
|
||||
@ -303,6 +312,15 @@ func (r *RPCServer) GetTokenInfo(
|
||||
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