Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Jun 25, 2024
1 parent 7f58909 commit f99525f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions internal/merkle/clock/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ func (mc *MerkleClock) checkIfBlockEncryptionEnabled(
if prevBlock.IsEncrypted != nil && *prevBlock.IsEncrypted {
return true, nil
}
// could do block.EncryptDelta(encKey)
}

return false, nil
Expand All @@ -172,10 +171,10 @@ func (mc *MerkleClock) ProcessBlock(
onlyHeads bool,
) error {
if !onlyHeads {
err := mc.crdt.Merge(ctx, block.Delta.GetDelta())
if err != nil {
return NewErrMergingDelta(blockLink.Cid, err)
}
err := mc.crdt.Merge(ctx, block.Delta.GetDelta())
if err != nil {
return NewErrMergingDelta(blockLink.Cid, err)
}
}

return mc.updateHeads(ctx, block, blockLink)
Expand Down
2 changes: 1 addition & 1 deletion internal/merkle/crdt/merklecrdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type MerkleClock interface {
links ...coreblock.DAGLink,
) (cidlink.Link, []byte, error)
// ProcessBlock processes a block and updates the CRDT state.
// The bool argument indicates whether only heads need to be updated. It is needed in case
// The bool argument indicates whether only heads need to be updated. It is needed in case
// merge should be skipped for example if the block is encrypted.
ProcessBlock(context.Context, *coreblock.Block, cidlink.Link, bool) error
}
Expand Down

0 comments on commit f99525f

Please sign in to comment.