From a9f48a76b926d3e32e40bbe9ecea83d3341903df Mon Sep 17 00:00:00 2001 From: wuwei1972 Date: Sun, 28 Apr 2019 23:11:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81--45?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=88=E7=BA=A6=E7=8A=B6=E6=80=81=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=8C=E5=BD=93=E5=90=88=E7=BA=A6=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=9C=A8=E6=9F=90=E4=B8=AA=E5=BF=AB=E7=85=A7?= =?UTF-8?q?=E4=B8=AD=E6=89=A7=E8=A1=8C=E4=BA=86=EF=BC=8C=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=85=A5=E5=9D=97=E3=80=82=E8=BF=99=E6=97=B6?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E5=90=88=E7=BA=A6=E7=9A=84=E5=8F=A6=E5=A4=96?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=83=A8=E7=BD=B2=E5=91=BD=E4=BB=A4=E8=BF=87?= =?UTF-8?q?=E6=9D=A5=EF=BC=8C=E5=BA=94=E8=AF=A5=E5=8F=AF=E4=BB=A5=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/scala/rep/sc/SandboxDispatcher.scala | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/scala/rep/sc/SandboxDispatcher.scala b/src/main/scala/rep/sc/SandboxDispatcher.scala index 46982ab3..842ec7c2 100644 --- a/src/main/scala/rep/sc/SandboxDispatcher.scala +++ b/src/main/scala/rep/sc/SandboxDispatcher.scala @@ -96,7 +96,7 @@ class SandboxDispatcher(moduleName: String, cid: String) extends ModuleBase(modu import scala.collection.immutable._ var ContractState: ContractStateType.Value = ContractStateType.ContractInNone - var txidOfContractDeploy: String = "" + //var txidOfContractDeploy: String = "" private var RouterOfParallelSandboxs: Router = null private var SerialSandbox: ActorRef = null @@ -115,8 +115,9 @@ class SandboxDispatcher(moduleName: String, cid: String) extends ModuleBase(modu if (txid == null) { None } else { - this.txidOfContractDeploy = deserialise(txid).asInstanceOf[String] - db.getTransDataByTxId(this.txidOfContractDeploy) + //this.txidOfContractDeploy = deserialise(txid).asInstanceOf[String] + //db.getTransDataByTxId(this.txidOfContractDeploy) + db.getTransDataByTxId(deserialise(txid).asInstanceOf[String]) } } @@ -131,10 +132,10 @@ class SandboxDispatcher(moduleName: String, cid: String) extends ModuleBase(modu val snapshot = ImpDataPreloadMgr.GetImpDataPreload(pe.getSysTag, da) val txid = snapshot.Get(key_tx) if (txid != null) { - val txid_str = deserialise(txid).asInstanceOf[String] - if (txid_str == this.txidOfContractDeploy) { + //val txid_str = deserialise(txid).asInstanceOf[String] + //if (txid_str == this.txidOfContractDeploy) { b = true - } + //} } b } @@ -150,7 +151,11 @@ class SandboxDispatcher(moduleName: String, cid: String) extends ModuleBase(modu //cc not exist if (t.`type` == Transaction.Type.CHAINCODE_DEPLOY) { this.ContractState = ContractStateType.ContractInSnapshot - this.txidOfContractDeploy = t.id + if (IsContractInSnapshot(da)) { + throw new SandboxException(ERR_REPEATED_CID) + }else{ + this.ContractState = ContractStateType.ContractInSnapshot + } } else { if (IsContractInSnapshot(da)) { //contract in snapshot