fix get proof (#302)

This commit is contained in:
SourceLink 2024-10-17 01:32:26 +08:00 committed by GitHub
parent 270b29b321
commit bb9512488e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -321,14 +321,14 @@ func NewTokenExecutionEngine(
if err == nil { if err == nil {
for _, proof := range proofs { for _, proof := range proofs {
if proof.IndexProof != nil && len(proof.IndexProof) != 0 { if proof.IndexProof != nil && len(proof.IndexProof) != 0 {
if proof.Index < inc { if proof.Difficulty < inc {
_, par, input, output, err := dataProofStore.GetDataTimeProof( _, par, input, output, err := dataProofStore.GetDataTimeProof(
pubSub.GetPeerID(), pubSub.GetPeerID(),
proof.Index-1, proof.Difficulty-1,
) )
if err == nil { if err == nil {
p := []byte{} p := []byte{}
p = binary.BigEndian.AppendUint32(p, proof.Index-1) p = binary.BigEndian.AppendUint32(p, proof.Difficulty-1)
p = binary.BigEndian.AppendUint32(p, par) p = binary.BigEndian.AppendUint32(p, par)
p = binary.BigEndian.AppendUint64( p = binary.BigEndian.AppendUint64(
p, p,