mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-08-11 03:13:11 +00:00
Updated Blockstores (markdown)
parent
597828cf20
commit
a1a3b0bc0b
@ -30,4 +30,10 @@ method listBlocks*(self: BlockStore, onBlock: OnBlock): Future[?!void]
|
||||
proc contains*(self: BlockStore, blk: Cid): Future[bool]
|
||||
## Check if the block exists in the blockstore.
|
||||
## Return false if error encountered
|
||||
```
|
||||
```
|
||||
|
||||
Notes:
|
||||
- all real errors should be signaled via Return
|
||||
- getBlock may fail to find a block with given id - return Block.none in this case in order to distinguish that from "hard failures", such as ruined DB. F.e. in BlockExc we can delete block in one task before another task get a chance to read it - it's not a failure at all
|
||||
- putBlock can create new block or overwrite existing one - we don't care, thus `void`
|
||||
- delBlock: if it can't delete a block - it's an error; if block already doesn't exist - we don't care (it may be deleted by other task)
|
||||
Loading…
x
Reference in New Issue
Block a user