blockstore: rename RuntimeHashing to HashOnRead

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 28b01dda
......@@ -76,7 +76,7 @@ type blockstore struct {
rehash bool
}
func (bs *blockstore) RuntimeHashing(enabled bool) {
func (bs *blockstore) HashOnRead(enabled bool) {
bs.rehash = enabled
}
......
......@@ -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
......@@ -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)
......
......@@ -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 {
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment