From 040d1da58d4afeeb166caa92c2b63087f51f2cb0 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Thu, 3 Nov 2016 15:39:49 +0100
Subject: [PATCH] Avoid message "invalid registration" if already a member -
 fix #194

---
 www/js/services/wallet-services.js | 2 +-
 www/js/services/wot-services.js    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js
index 63efa0907..dde9d8703 100644
--- a/www/js/services/wallet-services.js
+++ b/www/js/services/wallet-services.js
@@ -354,7 +354,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
               data.sigDate = block.time;
 
               // Check if self has been done on a valid block
-              if (blockNumber!== 0 && blockHash !== block.hash) {
+              if (!data.isMember && blockNumber!== 0 && blockHash !== block.hash) {
                 addEvent({type: 'error', message: 'ERROR.WALLET_INVALID_BLOCK_HASH'});
                 console.debug("Invalid membership for uid={0}: block hash not match a real block (block cancelled)".format(data.uid));
               }
diff --git a/www/js/services/wot-services.js b/www/js/services/wot-services.js
index 278b86fcd..0da07c5e4 100644
--- a/www/js/services/wot-services.js
+++ b/www/js/services/wot-services.js
@@ -192,7 +192,7 @@ angular.module('cesium.wot.services', ['ngResource', 'ngApi', 'cesium.bma.servic
             identity.sigDate = block.time;
 
             // Check if self has been done on a valid block
-            if (identity.number !== 0 && identity.hash !== block.hash) {
+            if (!identity.isMember && identity.number !== 0 && identity.hash !== block.hash) {
               addEvent(identity, {type: 'error', message: 'ERROR.IDENTITY_INVALID_BLOCK_HASH'});
               console.debug("Invalid membership for uid={0}: block hash not match a real block (block cancelled)".format(identity.uid));
             }
-- 
GitLab