mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-12-02 19:58:55 +08:00
修改waggerui的通过端地址读取证书信息代码。
This commit is contained in:
parent
c775c8d556
commit
a0b0503e1f
@ -315,7 +315,12 @@ class RestActor extends Actor with ModuleHelper with RepLogging {
|
||||
case pa: PostAddr =>
|
||||
//TODO 从短地址到证书得有信任列表里的,还有就是ws中存储的,两个都得做,如果证书在,返回证书字符串
|
||||
try{
|
||||
val peercert = ECDSASign.getCertByBitcoinAddr(pa.addr)
|
||||
var peercert : Option[Certificate] = None
|
||||
try{
|
||||
peercert = ECDSASign.getCertByBitcoinAddr(pa.addr)
|
||||
}catch{
|
||||
case el : Exception =>
|
||||
}
|
||||
val certKey = WorldStateKeyPreFix + pa.cid + "_" + PRE_CERT + pa.addr
|
||||
val kvcer = Option(sr.Get(certKey))
|
||||
if(peercert != None) {
|
||||
|
@ -129,7 +129,7 @@ object ECDSASign extends ECDSASign {
|
||||
*/
|
||||
def getCertByBitcoinAddr(addr: String): Option[Certificate] = {
|
||||
var tmpcert = trustkeysPubAddrMap.get(addr)
|
||||
if(tmpcert == null) {
|
||||
if(tmpcert == null && tmpcert != None) {
|
||||
throw new RuntimeException("证书不存在")
|
||||
}
|
||||
if(checkCertificate(new java.util.Date(), tmpcert.get )){
|
||||
|
@ -148,7 +148,7 @@ class Shim(system: ActorSystem, cid: String) {
|
||||
try{
|
||||
peercer = ECDSASign.getCertByBitcoinAddr(bitcoinaddr)
|
||||
}catch{
|
||||
case e : Exception => throw new Exception(e.getMessage)
|
||||
case e : Exception => //throw new Exception(e.getMessage)
|
||||
}
|
||||
// val addstr = (new code).encodeHex(bdata)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user