Skip to content

Commit

Permalink
check hasher
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitenjain14 committed Aug 18, 2023
1 parent 2db6fe4 commit c458849
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func (fc *BaseFileChanger) CommitToFileStore(ctx context.Context) error {
fileInputData.FixedMerkleRoot = fc.FixedMerkleRoot
fileInputData.ChunkSize = fc.ChunkSize
fileInputData.Hasher = GetHasher(fc.ConnectionID, encryption.Hash(fc.Path))
if fileInputData.Hasher == nil {
return common.NewError("invalid_parameters", "Invalid parameters. Error getting hasher for commit.")
}
_, err := filestore.GetFileStore().CommitWrite(fc.AllocationID, fc.ConnectionID, fileInputData)
if err != nil {
return common.NewError("file_store_error", "Error committing to file store. "+err.Error())
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/writemarker/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (wme *WriteMarkerEntity) VerifyMarker(ctx context.Context, dbAllocation *al
}

currTime := common.Now()
// blobber clock is allowed to be 10 seconds behind the current time
// blobber clock is allowed to be 60 seconds behind the current time
if wme.WM.Timestamp > currTime+60 {
return common.NewError("write_marker_validation_failed", "Write Marker timestamp is in the future")
}
Expand Down

0 comments on commit c458849

Please sign in to comment.