This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Commit f0c3e42 1 parent 673ddf8 commit f0c3e42 Copy full SHA for f0c3e42
File tree 2 files changed +13
-18
lines changed
2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 41
41
"chai" : " ^3.5.0" ,
42
42
"fs-pull-blob-store" : " ^0.4.1" ,
43
43
"idb-pull-blob-store" : " ^0.5.1" ,
44
- "ipfs-block" : " ^0.5.3 " ,
44
+ "ipfs-block" : " ^0.5.4 " ,
45
45
"ipfs-repo" : " ^0.11.2" ,
46
46
"lodash" : " ^4.17.2" ,
47
47
"ncp" : " ^2.0.0" ,
64
64
" npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>" ,
65
65
" wanderer <mjbecze@gmail.com>"
66
66
]
67
- }
67
+ }
Original file line number Diff line number Diff line change @@ -44,24 +44,19 @@ module.exports = class BlockService {
44
44
}
45
45
46
46
putStream ( ) {
47
- let ps
48
47
if ( this . isOnline ( ) ) {
49
- // NOTE: This will have to change in order for bitswap
50
- // to understand CID
51
- ps = this . _bitswap . putStream ( )
48
+ return this . _bitswap . putStream ( )
52
49
} else {
53
- ps = this . _repo . blockstore . putStream ( )
50
+ return pull (
51
+ pull . map ( ( blockAndCID ) => {
52
+ return {
53
+ data : blockAndCID . block . data ,
54
+ key : blockAndCID . cid . multihash
55
+ }
56
+ } ) ,
57
+ this . _repo . blockstore . putStream ( )
58
+ )
54
59
}
55
-
56
- return pull (
57
- pull . map ( ( blockAndCID ) => {
58
- return {
59
- data : blockAndCID . block . data ,
60
- key : blockAndCID . cid . multihash
61
- }
62
- } ) ,
63
- ps
64
- )
65
60
}
66
61
67
62
get ( cid , callback ) {
@@ -78,7 +73,7 @@ module.exports = class BlockService {
78
73
79
74
getStream ( cid ) {
80
75
if ( this . isOnline ( ) ) {
81
- return this . _bitswap . getStream ( cid . multihash )
76
+ return this . _bitswap . getStream ( cid )
82
77
}
83
78
84
79
return this . _repo . blockstore . getStream ( cid . multihash )
You can’t perform that action at this time.
0 commit comments