diff --git a/core/commands/block.go b/core/commands/block.go index 69b2c77d3..3b195d9f6 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -121,10 +121,10 @@ var blockPutCmd = &cmds.Command{ Tagline: "Store input as an IPFS block.", ShortDescription: ` 'ipfs block put' is a plumbing command for storing raw IPFS blocks. -It reads from stdin, and is a base58 encoded multihash. +It reads from stdin, and outputs the block's CID to stdout. -By default CIDv0 is going to be generated. Setting 'mhtype' to anything other -than 'sha2-256' or format to anything other than 'v0' will result in CIDv1. +Unless specified, this command returns dag-pb CIDv0 CIDs. Setting 'mhtype' to anything +other than 'sha2-256' or format to anything other than 'v0' will result in CIDv1. `, }, diff --git a/core/coreapi/block.go b/core/coreapi/block.go index 79b89ed02..2a371b904 100644 --- a/core/coreapi/block.go +++ b/core/coreapi/block.go @@ -56,6 +56,9 @@ func (api *BlockAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Bloc if settings.Pin { api.pinning.PinWithMode(b.Cid(), pin.Recursive) + if err := api.pinning.Flush(); err != nil { + return nil, err + } } return &BlockStat{path: path.IpldPath(b.Cid()), size: len(data)}, nil