mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 19:44:01 +08:00
chekc that size input to newHamtShard is a power of two
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
@ -85,7 +85,12 @@ func (d *Directory) AddChild(ctx context.Context, name string, nd node.Node) err
|
||||
}
|
||||
|
||||
func (d *Directory) switchToSharding(ctx context.Context) error {
|
||||
d.shard = hamt.NewHamtShard(d.dserv, DefaultShardWidth)
|
||||
s, err := hamt.NewHamtShard(d.dserv, DefaultShardWidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
d.shard = s
|
||||
for _, lnk := range d.dirnode.Links() {
|
||||
cnd, err := d.dserv.Get(ctx, lnk.Cid)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user