refactor: strip out the proofSectionLength from all for readability of the offsets

This commit is contained in:
Derrick Hammer 2024-03-01 02:24:20 -05:00
parent efb11a9c50
commit 365ba04844
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

View File

@ -80,13 +80,15 @@ func (m *MediaMetadata) decodeProof(dec *msgpack.Decoder) error {
proofSectionLength := utils.DecodeEndian(all[0:2])
bodyBytes := all[2+proofSectionLength:]
all = all[2:]
bodyBytes := all[proofSectionLength:]
if proofSectionLength == 0 {
return nil
}
childDec := msgpack.NewDecoder(bytes.NewReader(all[2 : 2+proofSectionLength]))
childDec := msgpack.NewDecoder(bytes.NewReader(all[:proofSectionLength]))
b3hash := blake3.Sum256(bodyBytes)