@@ -77,22 +77,22 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
77
77
78
78
isExist = a .ID != ""
79
79
80
- if ! isExist {
81
- foundBlobber := false
82
- for _ , blobberConnection := range sa .BlobberDetails {
83
- if blobberConnection .BlobberID != node .Self .ID {
84
- continue
85
- }
86
- foundBlobber = true
80
+ foundBlobber := false
81
+ for _ , blobberConnection := range sa .BlobberDetails {
82
+ if blobberConnection .BlobberID != node .Self .ID {
83
+ continue
84
+ }
85
+ foundBlobber = true
86
+ a .BlobberSize = int64 (math .Ceil (float64 (sa .Size ) / float64 (sa .DataShards )))
87
+ if ! isExist {
87
88
a .AllocationRoot = ""
88
- a .BlobberSize = int64 (math .Ceil (float64 (sa .Size ) / float64 (sa .DataShards )))
89
89
a .BlobberSizeUsed = 0
90
- break
91
- }
92
- if ! foundBlobber {
93
- return nil , common .NewError ("invalid_blobber" ,
94
- "Blobber is not part of the open connection transaction" )
95
90
}
91
+ break
92
+ }
93
+ if ! foundBlobber {
94
+ return nil , common .NewError ("invalid_blobber" ,
95
+ "Blobber is not part of the open connection transaction" )
96
96
}
97
97
98
98
// set/update fields
@@ -151,6 +151,7 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
151
151
"time_unit" : a .TimeUnit ,
152
152
"file_options" : a .FileOptions ,
153
153
"start_time" : a .StartTime ,
154
+ "blobber_size" : a .BlobberSize ,
154
155
}
155
156
156
157
updateOption := func (alloc * Allocation ) {
@@ -164,6 +165,7 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
164
165
alloc .TimeUnit = a .TimeUnit
165
166
alloc .FileOptions = a .FileOptions
166
167
alloc .StartTime = a .StartTime
168
+ alloc .BlobberSize = a .BlobberSize
167
169
}
168
170
err = Repo .UpdateAllocation (ctx , a , updateMap , updateOption )
169
171
}
0 commit comments