CHAINCODE_SET_STATE类型的交易紧跟deploy交易

This commit is contained in:
c4w 2019-03-22 14:58:13 +08:00
parent 3b7ff99e26
commit febd0e51d6

View File

@ -289,8 +289,13 @@ class TransProcessor(name: String, da:String, parent: ActorRef) extends Actor {
val sr = ImpDataAccess.GetDataAccess(sTag)
val state_bytes = sr.Get(key_tx_state)
//合约不存在
if(state_bytes == null)
throw new SandboxException(ERR_INVOKE_CHAINCODE_NOT_EXIST)
if(state_bytes == null){
//进一步检查sn对应actor,判断是否存在合约正在deploying
val sn = PRE_SUB_ACTOR+tx_cid
val cref = context.child(sn)
if(cref == None)
throw new SandboxException(ERR_INVOKE_CHAINCODE_NOT_EXIST)
}
else{
val state = deserialise(state_bytes).asInstanceOf[Boolean]
Sandbox.setContractState(tx_cid, state)