@@ -96,6 +96,7 @@ export const recreateInitialHamtLevel = async (links: PBLink[]): Promise<Bucket<
96
96
} , bucket , pos )
97
97
98
98
bucket . _putObjectAt ( pos , subBucket )
99
+ return
99
100
}
100
101
101
102
await bucket . put ( linkName . substring ( 2 ) , {
@@ -126,6 +127,7 @@ export const addLinksToHamtBucket = async (blockstore: Blockstore, links: PBLink
126
127
bucket . _putObjectAt ( pos , subBucket )
127
128
128
129
await addLinksToHamtBucket ( blockstore , node . Links , subBucket , rootBucket , options )
130
+ return
129
131
}
130
132
131
133
await rootBucket . put ( linkName . substring ( 2 ) , {
@@ -218,7 +220,7 @@ export const generatePath = async (root: Directory, name: string, blockstore: Bl
218
220
// found subshard
219
221
log ( `Found subshard ${ segment . prefix } ` )
220
222
const block = await blockstore . get ( link . Hash )
221
- const node = dagPB . decode ( block )
223
+ const node = segment . node = dagPB . decode ( block )
222
224
223
225
// subshard hasn't been loaded, descend to the next level of the HAMT
224
226
if ( path [ i + 1 ] == null ) {
@@ -247,8 +249,6 @@ export const generatePath = async (root: Directory, name: string, blockstore: Bl
247
249
248
250
// add intermediate links to bucket
249
251
await addLinksToHamtBucket ( blockstore , node . Links , segment . bucket , rootBucket , options )
250
-
251
- segment . node = node
252
252
}
253
253
254
254
await rootBucket . put ( name , true )
0 commit comments