Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 5d8a483

Browse files
authored
Merge pull request #544 from ipfs/update-block-rm
docs: update block rm description
2 parents e836aea + c78e29f commit 5d8a483

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

SPEC/BLOCK.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,11 @@ A great source of [examples][] can be found in the tests for this API.
125125
- force (boolean): Ignores nonexistent blocks.
126126
- quiet (boolean): write minimal output
127127

128-
`callback` must follow `function (err, result) {}` signature, where `err` is an error if the operation was not successful and `result` is an object, containing hash and error strings.
128+
`callback` must follow `function (err, result) {}` signature, where `err` is an error if the operation was not successful and `result` is a list of objects, containing hash and (potentially) error strings.
129129

130-
If no `callback` is passed, a promise is returned.
130+
If an error string is present for a given object in `result`, the block with that hash was not removed and the string will contain the reason why, for example if the block was pinned.
131131

132-
NOTE: If the specified block is pinned it won't be removed and no error
133-
will be returned
132+
If no `callback` is passed, a promise is returned.
134133

135134
**Example:**
136135

@@ -139,7 +138,7 @@ ipfs.block.rm(cid, function (err, result) {
139138
if (err) {
140139
throw err
141140
}
142-
console.log(result.hash)
141+
console.log(result[0].hash)
143142
})
144143
```
145144

0 commit comments

Comments
 (0)