在system.conf文件中增加配置字段,

//证书状态改变函数名,账号管理合约中的改变证书状态的函数的函数名
    CertStatusChangeFunction="UpdateCertStatus"
    存储时根据这个函数名可以知道确认出块的交易中出现改变证书状态的交易,需要通知证书缓存,改变证书的状态。
This commit is contained in:
wuwei1972 2019-06-07 17:37:57 +08:00
parent aa7a99f3b2
commit 4370aa81f2
3 changed files with 13 additions and 1 deletions

View File

@ -108,6 +108,8 @@ system {
account{
chaincodename = "ContractCert"//账户管理合约的名称
chaincodeversion = 1
//证书状态改变函数名
CertStatusChangeFunction="UpdateCertStatus"
}
diskspaceManager{

View File

@ -52,6 +52,7 @@ object SystemProfile {
private[this] var _VOTENODELIST : List[String] = new ArrayList[String]
private[this] var _ACCOUNTCHAINCODENAEM : String = "ACCOUNTCHAINCODENAME"
private[this] var _ACCOUNTCHAINCODEVERSION: Int = 1
private[this] var _CertStatusChangeFunction : String = "UpdateCertStatus"
private[this] var _GENESISNODENAME:String = ""
private[this] var _BLOCK_LENGTH: Int = 120000//区块的最大长度
private[this] var _NUMBER_OF_TRANSPROCESSOR = 100 //
@ -77,6 +78,7 @@ object SystemProfile {
private def VOTENODELIST : List[String] = _VOTENODELIST
private def ACCOUNTCHAINCODENAEM = _ACCOUNTCHAINCODENAEM
private def ACCOUNTCHAINCODVERSION = _ACCOUNTCHAINCODEVERSION
private def CertStatusChangeFunction = _CertStatusChangeFunction
private def NUMBER_OF_TRANSPROCESSOR = _NUMBER_OF_TRANSPROCESSOR
@ -117,6 +119,10 @@ object SystemProfile {
private def ACCOUNTCHAINCODENAEM_=(value:String):Unit={
_ACCOUNTCHAINCODENAEM = value
}
private def CertStatusChangeFunction_=(value:String):Unit={
_CertStatusChangeFunction = value
}
private def ACCOUNTCHAINCODEVERSION_=(value:Int):Unit={
_ACCOUNTCHAINCODEVERSION = value
@ -208,6 +214,8 @@ object SystemProfile {
CONTRACTOPERATIONMODE_=(config.getInt("system.contractOperationMode"))
ACCOUNTCHAINCODENAEM_= (config.getString("system.account.chaincodename"))
ACCOUNTCHAINCODEVERSION_=(config.getInt("system.account.chaincodeversion"))
CertStatusChangeFunction_= (config.getString("system.account.CertStatusChangeFunction"))
GENESISNODENAME_=(config.getString("system.genesis_node_name"))
NUMBER_OF_TRANSPROCESSOR_=(config.getInt("system.number_of_transProcessor"))
@ -254,6 +262,8 @@ object SystemProfile {
def getVoteNodeList = VOTENODELIST
def getAccountChaincodeName = ACCOUNTCHAINCODENAEM
def getCertStatusChangeFunction = CertStatusChangeFunction
def getAccountChaincodeVersion = ACCOUNTCHAINCODVERSION

View File

@ -505,7 +505,7 @@ class ImpDataAccess private (SystemName: String) extends IDataAccess(SystemName)
if (trans.length > 0) {
breakable(
trans.foreach(f => {
if (f.id.equals(txid) && f.getCid.chaincodeName == SystemProfile.getAccountChaincodeName && f.`type` == rep.protos.peer.Transaction.Type.CHAINCODE_INVOKE && f.para.ipt.get.function == "UpdateCertStatus") {
if (f.id.equals(txid) && f.getCid.chaincodeName == SystemProfile.getAccountChaincodeName && f.`type` == rep.protos.peer.Transaction.Type.CHAINCODE_INVOKE && f.para.ipt.get.function == SystemProfile.getCertStatusChangeFunction) {
rel = true
break
}