diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 6749473f242e72d526596a84b09b992922cbce0a..60c0deb561146e3e342e5bb16326b4351fc7615a 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -774,7 +774,8 @@ "COULD_NOT_ADD_EXISTING_WALLET": "Wallet already existing in the list.", "UNKNOWN_WALLET_ID": "Unknown secondary wallet.", "RESTORE_WALLET_LIST_FAILED": "Unable to restore the list of wallets.", - "INVALID_FILE_FORMAT": "Invalid file format." + "INVALID_FILE_FORMAT": "Invalid file format.", + "SAME_TX_RECIPIENT": "The recipient must be different from the issuer." }, "INFO": { "POPUP_TITLE": "Information", diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index 378db495a54c815e83d76310db4d000eb00a83aa..725db3dbffde55625fbb51841eaffb925306f927 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -774,7 +774,8 @@ "COULD_NOT_ADD_EXISTING_WALLET": "Wallet already existing in the list.", "UNKNOWN_WALLET_ID": "Unknown secondary wallet.", "RESTORE_WALLET_LIST_FAILED": "Unable to restore the list of wallets.", - "INVALID_FILE_FORMAT": "Invalid file format." + "INVALID_FILE_FORMAT": "Invalid file format.", + "SAME_TX_RECIPIENT": "The recipient must be different from the issuer." }, "INFO": { "POPUP_TITLE": "Information", diff --git a/www/i18n/locale-es-ES.json b/www/i18n/locale-es-ES.json index b0515312ea37d623ebfab1ecb0ef55e74e3d63fc..b34ee808529324ebdaa0bc8ef42caa6248bd825d 100644 --- a/www/i18n/locale-es-ES.json +++ b/www/i18n/locale-es-ES.json @@ -713,7 +713,8 @@ "EXISTING_ACCOUNT_REQUEST": "Por favor, cambie su frase secreta para que coincida con una cuenta sin usar.", "GET_LICENSE_FILE_FAILED": "Error al obtener el archivo de licencia", "CHECK_NETWORK_CONNECTION": "Ningún nodo parece alcanzable.<br/><br/><b>Compruebe la conexión a Internet</b>.", - "INVALID_FILE_FORMAT": "Formato de archivo inválido." + "INVALID_FILE_FORMAT": "Formato de archivo inválido.", + "SAME_TX_RECIPIENT": "El destinatario debe ser diferente del emisor." }, "INFO": { "POPUP_TITLE": "Información", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 347d37504734c739ce2ff4ee9d00007a8dfa8761..1ba9781ba5796ddd1e8aa0cbc1a01da7b08a2002 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -774,7 +774,8 @@ "COULD_NOT_ADD_EXISTING_WALLET": "Portefeuille déjà existant dans la liste.", "UNKNOWN_WALLET_ID": "Portefeuille secondaire inconnu.", "RESTORE_WALLET_LIST_FAILED": "Échec de la restauration des portefeuilles secondaires.", - "INVALID_FILE_FORMAT": "Format de fichier invalide." + "INVALID_FILE_FORMAT": "Format de fichier invalide.", + "SAME_TX_RECIPIENT": "Le destinataire doit être différent de l'émetteur." }, "INFO": { "POPUP_TITLE": "Information", diff --git a/www/i18n/locale-it-IT.json b/www/i18n/locale-it-IT.json index e36fab801ba81d6c8b9fc825c7947d0ed075e012..4d3f3407d0b4b475b004a7a50c58d6c2ddef8ff7 100644 --- a/www/i18n/locale-it-IT.json +++ b/www/i18n/locale-it-IT.json @@ -737,7 +737,8 @@ "SAVE_BEFORE_LEAVE_TITLE": "Modifiche non salvate", "LOGOUT": "Sei sicuro/a di voler chiudere la sessione?", "USE_FALLBACK_NODE": "Peer <b>{{old}}</b> indisponibile o indirizzo errato.<br/><br/>Vuoi utilizzare temporanemante il <b>{{new}}</b> nodo?", - "ISSUE_524_SEND_LOG": "La transaction a été rejettée, à cause d'une anomalie connue (ticket #524) mais <b>non reproduite</b>.<br/><br/>Pour nous aider les développeurs à corriger cette erreur, <b>acceptez-vous la transmission de vos logs</b> par message ?<br/><small>(Aucune donnée confidentielle n'est envoyée)</small>." + "INVALID_FILE_FORMAT": "Formato file non valido.", + "SAME_TX_RECIPIENT": "Il destinatario deve essere diverso dall'emittente." }, "DOWNLOAD": { "POPUP_TITLE": "<b>File di cancellazione dell'identità /b>", diff --git a/www/js/controllers/transfer-controllers.js b/www/js/controllers/transfer-controllers.js index 1be2e91852219627c5d29f6b30891f4c024731c9..61c1d16e7d200ecb913425fd69b7a0628891bda3 100644 --- a/www/js/controllers/transfer-controllers.js +++ b/www/js/controllers/transfer-controllers.js @@ -226,6 +226,7 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc }; $scope.onAmountChanged = function() { + if ($scope.sending) return; // skip if sending TX var amount = $scope.formData.amount; if (amount && typeof amount === "string") { @@ -333,12 +334,12 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc } }) .then(function() { - $scope.sending = false; UIUtils.loading.hide(); return $scope.closeModal(true); }) .then(function(res) { $timeout(function() { + $scope.sending = false; UIUtils.toast.show('INFO.TRANSFER_SENT'); }, 500); return res; diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index 3c36328754e075d80429bbffec8ef4d65b5cae46..646d2528046a79692e8c9e55d0f9e63573d72298 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -22,11 +22,11 @@ angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.se STORAGE_DATA_PREFIX: 'data-', STORAGE_SECKEY: 'seckey', /* Need for compat with old currencies (test_net and sou) */ - TX_VERSION: csConfig.compatProtocol_0_80 ? 3 : BMA.constants.PROTOCOL_VERSION, - IDTY_VERSION: csConfig.compatProtocol_0_80 ? 2 : BMA.constants.PROTOCOL_VERSION, - MS_VERSION: csConfig.compatProtocol_0_80 ? 2 : BMA.constants.PROTOCOL_VERSION, - CERT_VERSION: csConfig.compatProtocol_0_80 ? 2 : BMA.constants.PROTOCOL_VERSION, - REVOKE_VERSION: csConfig.compatProtocol_0_80 ? 2 : BMA.constants.PROTOCOL_VERSION, + TX_VERSION: BMA.constants.PROTOCOL_VERSION, + IDTY_VERSION: BMA.constants.PROTOCOL_VERSION, + MS_VERSION: BMA.constants.PROTOCOL_VERSION, + CERT_VERSION: BMA.constants.PROTOCOL_VERSION, + REVOKE_VERSION: BMA.constants.PROTOCOL_VERSION, TX_MAX_INPUTS_COUNT: 40 // Allow to get a TX with less than 100 rows (=max row count in Duniter protocol) }, data = {}, @@ -1071,7 +1071,10 @@ angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.se var minBase = filterBase; var maxBase = filterBase; _.find(data.sources || [], function(source) { - if (!source.consumed && source.base == filterBase){ + if (!source.consumed && source.base === filterBase + // Filter on simple SIG output condition - fix #845 + && BMA.regexp.TX_OUTPUT_SIG.exec(source.condition) + ) { sourcesAmount += powBase(source.amount, source.base); sources.push(source); } @@ -1123,6 +1126,9 @@ angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.se if (!isLogin()){ throw {message:'ERROR.NEED_LOGIN_FIRST'}; } + if (destPub === data.pubkey){ + throw {message:'ERROR.SAME_TX_RECIPIENT'}; + } if (!amount) { throw {message:'ERROR.AMOUNT_REQUIRED'}; } diff --git a/www/templates/wallet/item_tx.html b/www/templates/wallet/item_tx.html index 2e4956ed36f98e1d582d21a3f7ff0d46013d5432..5959b6d7f4f5bdad6cee62bc5a064cd1aac3a72a 100644 --- a/www/templates/wallet/item_tx.html +++ b/www/templates/wallet/item_tx.html @@ -8,7 +8,7 @@ <a class="" ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.uid})" ng-if="::tx.uid"> {{::tx.name||tx.uid}} </a> - <a class="gray" ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.uid})" ng-if="::!tx.uid"> + <a class="gray" ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.uid})" ng-if="::!tx.uid && tx.pubkey"> <i class="ion-key gray"></i> {{::tx.pubkey | formatPubkey}} <span ng-if="::tx.name"> - {{::tx.name | truncText:40}}</span> @@ -38,7 +38,6 @@ <!-- not locked TX --> <span ng-if="::!tx.lockedOutputs" class="badge item-note" ng-class="{'badge-calm': tx.amount > 0}"> - <!--<span class="hidden-xs" ng-if=":rebind:tx.amount>0">+</span>--> <span ng-bind-html=":rebind:tx.amount| formatAmount:{currency:$root.currency.name}"></span> </span> @@ -47,8 +46,7 @@ class="badge item-note" ng-class="{'badge-calm': tx.amount > 0}" ng-click="showLockedOutputsPopover(tx, $event)"> - <i class="icon ion-locked" ></i> - <!--<span class="hidden-xs" ng-if=":rebind:tx.amount>0">+</span>--> + <b class="ion-locked" ></b> <span ng-bind-html=":rebind:tx.amount| formatAmount:{currency:$root.currency.name}"></span> </a>