From e9730bf5a57524b78cf62a55e1f5b57be6bdd266 Mon Sep 17 00:00:00 2001 From: Peter Gilbert Date: Tue, 14 Jan 2020 11:27:50 -0800 Subject: [PATCH] Temporarily disable consensus address checks at genesis --- go/registry/api/api.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/go/registry/api/api.go b/go/registry/api/api.go index 0ac02b3b692..c5cdb512780 100644 --- a/go/registry/api/api.go +++ b/go/registry/api/api.go @@ -479,13 +479,16 @@ func VerifyRegisterNodeArgs( // nolint: gocyclo return nil, ErrInvalidArgument } consensusAddressRequired := n.HasRoles(ConsensusAddressRequiredRoles) - if err := verifyAddresses(params, consensusAddressRequired, n.Consensus.Addresses); err != nil { - addrs, _ := json.Marshal(n.Consensus.Addresses) - logger.Error("RegisterNode: missing/invalid consensus addresses", - "node", n, - "consensus_addrs", addrs, - ) - return nil, err + if !isGenesis { + // Temporarily allow invalid consensus addresses at genesis + if err := verifyAddresses(params, consensusAddressRequired, n.Consensus.Addresses); err != nil { + addrs, _ := json.Marshal(n.Consensus.Addresses) + logger.Error("RegisterNode: missing/invalid consensus addresses", + "node", n, + "consensus_addrs", addrs, + ) + return nil, err + } } // If node is a key manager, ensure that it is owned by the key manager