database: use db.DeleteIndex instead of calling deleteIndex directly

The db.DeleteIndex method checks that db.RemoteClient is not nil
before dereferencing it. The direct call to deleteIndex did not,
and therefore panicked when db.RemoteClient was nil.

This makes Database.Block method consistent with Database.Put and
Database.Delete, which also use the db.DeleteIndex method.

With this change, go test ./database passes.

Change-Id: I90514bc1e855e125a9db57a93d2d7a88bce67e2e
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/172961
Reviewed-by: Tuo Shan <shantuo@google.com>
1 file changed