@cryptotaxi247 / kubo / commits / bc02a61e7

fix: flush pin on block put

Dirk McCormick committed Jun 12, 2019 at 10:23 UTC bc02a61e7c015e41d15a1533b37090de466274d1
2 files changed +6 -3
core/commands/block.go
+3 -3
@@ -123,10 +123,10 @@ var blockPutCmd = &cmds.Command{
123 Tagline: "Store input as an IPFS block.",
124 ShortDescription: `
125 'ipfs block put' is a plumbing command for storing raw IPFS blocks.
126 -It reads from stdin, and <key> is a base58 encoded multihash.
126 +It reads from stdin, and outputs a multihash to stdout.
127
128 -By default CIDv0 is going to be generated. Setting 'mhtype' to anything other
129 -than 'sha2-256' or format to anything other than 'v0' will result in CIDv1.
128 +By default the multihash is output in CIDv0 format. Setting 'mhtype' to anything
129 +other than 'sha2-256' or format to anything other than 'v0' will result in CIDv1.
130 `,
131 },
132
core/coreapi/block.go
+3
@@ -56,6 +56,9 @@ func (api *BlockAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Bloc
56
57 if settings.Pin {
58 api.pinning.PinWithMode(b.Cid(), pin.Recursive)
59 + if err := api.pinning.Flush(); err != nil {
60 + return nil, err
61 + }
62 }
63
64 return &BlockStat{path: path.IpldPath(b.Cid()), size: len(data)}, nil