Skip to content

Commit

Permalink
Merge pull request #3143 from ipfs/feat/bs/rename-hashonread
Browse files Browse the repository at this point in the history
blockstore: rename RuntimeHashing to HashOnRead
  • Loading branch information
whyrusleeping authored Sep 8, 2016
2 parents 0849375 + dfc58c7 commit 531b89a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blocks/blockstore/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type blockstore struct {
rehash bool
}

func (bs *blockstore) RuntimeHashing(enabled bool) {
func (bs *blockstore) HashOnRead(enabled bool) {
bs.rehash = enabled
}

Expand Down
4 changes: 2 additions & 2 deletions blocks/blockstore/blockstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestPutThenGetBlock(t *testing.T) {
}
}

func TestRuntimeHashing(t *testing.T) {
func TestHashOnRead(t *testing.T) {
orginalDebug := u.Debug
defer (func() {
u.Debug = orginalDebug
Expand All @@ -69,7 +69,7 @@ func TestRuntimeHashing(t *testing.T) {
bl2 := blocks.NewBlock([]byte("some other data"))
bs.Put(blBad)
bs.Put(bl2)
bs.RuntimeHashing(true)
bs.HashOnRead(true)

if _, err := bs.Get(bl.Key()); err != ErrHashMismatch {
t.Fatalf("expected '%v' got '%v'\n", ErrHashMismatch, err)
Expand Down
2 changes: 1 addition & 1 deletion core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
}

if rcfg.Datastore.HashOnRead {
bs.RuntimeHashing(true)
bs.HashOnRead(true)
}

if cfg.Online {
Expand Down
2 changes: 1 addition & 1 deletion core/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ var repoVerifyCmd = &cmds.Command{
defer close(out)
bs := bstore.NewBlockstore(nd.Repo.Datastore())

bs.RuntimeHashing(true)
bs.HashOnRead(true)

keys, err := bs.AllKeysChan(req.Context())
if err != nil {
Expand Down

0 comments on commit 531b89a

Please sign in to comment.