From d8d711d15a57aa17353c50a88da5e2a9c59583ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talha=20Bu=C4=9Fra=20Bulut?= Date: Sat, 9 Jun 2018 16:50:47 +0300 Subject: [PATCH] transfer memo encryption fix --- src/controllers/transfer.js | 7 ++++++- src/filters/transfer-memo.js | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/controllers/transfer.js b/src/controllers/transfer.js index 4639e795f6..60c8f24225 100644 --- a/src/controllers/transfer.js +++ b/src/controllers/transfer.js @@ -155,7 +155,12 @@ export default ($scope, $rootScope, $routeParams, $timeout, $location, $filter, const amount = formatStrAmount($scope.amount, $scope.asset); let memo = $scope.memo.trim(); - if(memo.startsWith('#')){ + if (memo.startsWith('#')) { + if (!$rootScope.user.keys['memo']) { + $rootScope.showError('Memo private key required to create encrypted memo'); + return; + } + const senderPrivateKey = cryptoService.decryptKey($rootScope.user.keys['memo']); const receiverPublicKey = $scope.toData.memo_key; diff --git a/src/filters/transfer-memo.js b/src/filters/transfer-memo.js index cc6ba8fbd0..449115da04 100644 --- a/src/filters/transfer-memo.js +++ b/src/filters/transfer-memo.js @@ -3,6 +3,10 @@ import steem from 'steem'; export default ($rootScope, cryptoService) => { const transferMemoFilter = (op) => { + if(!op.memo){ + return ''; + } + if (!op.memo.startsWith('#')) { return op.memo; }