From 7f1cd4199a3c638e99f4e81d2db8c94019d5a5a0 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sat, 29 Feb 2020 15:31:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0countAction=E5=80=BC=EF=BC=9B?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=80=81=E6=9D=A5=E7=9A=84Amount=E8=A6=81?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E8=BD=AC=E6=88=90Number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ActionTransfer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ActionTransfer.js b/ActionTransfer.js index 090ea1d..6c7a332 100644 --- a/ActionTransfer.js +++ b/ActionTransfer.js @@ -25,9 +25,9 @@ MOM.executableMe = async function() { MOM.executeMe = async function () { let sender= await wo.Account.getOne({Account: { address: this.actorAddress }}) if (sender && sender.type !== 'multisig' && this.toAddress != this.actorAddress && sender.balance >= this.amount + this.fee){ - await sender.setMe({Account:{ balance: sender.balance-this.amount-this.fee }, cond:{ address:sender.address}}) + await sender.setMe({Account:{ balance: Number(sender.balance)-Number(this.amount)-Number(this.fee), countAction: sender.countAction+1 }, cond:{ address:sender.address}}) let getter= await wo.Account.getOne({Account: { address: this.toAddress }}) || await wo.Account.addOne({Account: { address: this.toAddress }}) - await getter.setMe({Account:{ balance: getter.balance+this.amount }, cond:{ address:getter.address}}) + await getter.setMe({Account:{ balance: Number(getter.balance)+Number(this.amount), countAction: getter.countAction+1 }, cond:{ address:getter.address}}) mylog.info('Excecuted action='+JSON.stringify(this)) return this }