mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-12-02 11:48:10 +08:00
在system.conf文件中增加配置字段,
//证书状态改变函数名,账号管理合约中的改变证书状态的函数的函数名 CertStatusChangeFunction="UpdateCertStatus" 存储时根据这个函数名可以知道确认出块的交易中出现改变证书状态的交易,需要通知证书缓存,改变证书的状态。
This commit is contained in:
parent
aa7a99f3b2
commit
4370aa81f2
@ -108,6 +108,8 @@ system {
|
||||
account{
|
||||
chaincodename = "ContractCert"//账户管理合约的名称
|
||||
chaincodeversion = 1
|
||||
//证书状态改变函数名
|
||||
CertStatusChangeFunction="UpdateCertStatus"
|
||||
}
|
||||
|
||||
diskspaceManager{
|
||||
|
@ -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
|
||||
|
||||
@ -118,6 +120,10 @@ object SystemProfile {
|
||||
_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"))
|
||||
|
||||
@ -255,6 +263,8 @@ object SystemProfile {
|
||||
|
||||
def getAccountChaincodeName = ACCOUNTCHAINCODENAEM
|
||||
|
||||
def getCertStatusChangeFunction = CertStatusChangeFunction
|
||||
|
||||
def getAccountChaincodeVersion = ACCOUNTCHAINCODVERSION
|
||||
|
||||
def getGenesisNodeName = GENESISNODENAME
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user