Implement buffered blocktore GetSize()
This commit is contained in:
parent
9b1d2f4c13
commit
54c0ae17f4
@ -104,7 +104,12 @@ func (bs *BufferedBS) Get(c cid.Cid) (block.Block, error) {
|
||||
}
|
||||
|
||||
func (bs *BufferedBS) GetSize(c cid.Cid) (int, error) {
|
||||
panic("nyi")
|
||||
s, err := bs.read.GetSize(c)
|
||||
if err == bstore.ErrNotFound || s == 0 {
|
||||
return bs.write.GetSize(c)
|
||||
}
|
||||
|
||||
return 0, err
|
||||
}
|
||||
|
||||
func (bs *BufferedBS) Put(blk block.Block) error {
|
||||
|
Loading…
Reference in New Issue
Block a user