diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go index 57d139ac98..9a80405ffc 100644 --- a/swarm/api/http/server_test.go +++ b/swarm/api/http/server_test.go @@ -69,6 +69,7 @@ func TestBzzResource(t *testing.T) { if !bytes.Equal(b, []byte(keybyteshash)) { t.Fatalf("resource update hash mismatch, expected '%s' got '%s'", keybyteshash, b) } + t.Logf("creatreturn %v / %v", keybyteshash, b) // get latest update (1.1) through resource directly url = fmt.Sprintf("%s/bzz-resource:/%x", srv.URL, keybytes) @@ -97,7 +98,7 @@ func TestBzzResource(t *testing.T) { } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - t.Fatalf("Update returned %d", resp.Status) + t.Fatalf("Update returned %s", resp.Status) } // get latest update (1.2) through resource directly diff --git a/swarm/storage/resource.go b/swarm/storage/resource.go index 21e8466743..7bd437e924 100644 --- a/swarm/storage/resource.go +++ b/swarm/storage/resource.go @@ -625,7 +625,8 @@ func (self *ResourceHandler) Close() { } func (self *ResourceHandler) GetBlock() (uint64, error) { - ctx, _ := context.WithCancel(self.ctx) + ctx, cancel := context.WithCancel(self.ctx) + defer cancel() blockheader, err := self.ethClient.HeaderByNumber(ctx, nil) if err != nil { return 0, err