From f08636c518e08bd5d3ad5fbd6402a4a7d3de2a2e Mon Sep 17 00:00:00 2001
From: Alex Vanin <alexey@nspcc.ru>
Date: Thu, 30 Sep 2021 20:39:42 +0300
Subject: [PATCH] [#872] cmd/neofs-node: Don't lose local container size
 estimations

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
---
 cmd/neofs-node/container.go | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go
index b57b983e8..dabcdefd2 100644
--- a/cmd/neofs-node/container.go
+++ b/cmd/neofs-node/container.go
@@ -228,16 +228,6 @@ func (*morphLoadWriter) Close() error {
 	return nil
 }
 
-type nopLoadWriter struct{}
-
-func (nopLoadWriter) Put(containerSDK.UsedSpaceAnnouncement) error {
-	return nil
-}
-
-func (nopLoadWriter) Close() error {
-	return nil
-}
-
 type remoteLoadAnnounceProvider struct {
 	key *ecdsa.PrivateKey
 
@@ -251,15 +241,10 @@ type remoteLoadAnnounceProvider struct {
 }
 
 func (r *remoteLoadAnnounceProvider) InitRemote(srv loadroute.ServerInfo) (loadcontroller.WriterProvider, error) {
-	if srv == nil {
+	if srv == nil || r.netmapKeys.IsLocalKey(srv.PublicKey()) {
 		return r.deadEndProvider, nil
 	}
 
-	if r.netmapKeys.IsLocalKey(srv.PublicKey()) {
-		// if local => return no-op writer
-		return loadcontroller.SimpleWriterProvider(new(nopLoadWriter)), nil
-	}
-
 	var info client.NodeInfo
 
 	err := client.NodeInfoFromRawNetmapElement(&info, srv)