add: condition for being able to selfReconstruct

This commit is contained in:
Agnish Ghosh 2024-07-29 19:00:43 +05:30
parent 7faec9b7a3
commit 329fc21eab
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
1 changed files with 11 additions and 0 deletions

View File

@ -338,3 +338,14 @@ func verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Re
return err("DataColumnSidecar: inclusion proof not valid") return err("DataColumnSidecar: inclusion proof not valid")
ok() ok()
proc selfReconstructDataColumns*(numCol: uint64):
bool =
# This function tells whether data columns can be
# reconstructed or not
const totalColumns = NUMBER_OF_COLUMNS.uint64
let
columnsNeeded = totalColumns div 2 + totalColumns mod 2
if numCol >= columnsNeeded:
return true
false