Commit d3ada7e4 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] Revocation was not pulled from mempool

parent 71e2d7c7
......@@ -101,6 +101,10 @@ export class Contacter {
postRenew(ms:string) {
return this.post('/blockchain/membership', dtos.Membership, { membership: ms })
}
postRevocation(rev:string) {
return this.post('/wot/revoke', dtos.Identity, { revocation: rev })
}
wotPending() {
return this.get('/wot/pending', dtos.MembershipList)
......
......@@ -14,8 +14,9 @@
import {Contacter} from "./contacter"
import {verify} from "../../../lib/common-libs/crypto/keyring"
import {rawer} from "../../../lib/common-libs/index"
import {HttpRequirements} from "../../bma/lib/dtos"
export const req2fwd = async (requirements:any, toHost:string, toPort:number, logger:any) => {
export const req2fwd = async (requirements: HttpRequirements, toHost:string, toPort:number, logger:any) => {
const mss:any = {};
const identities:any = {};
const certs:any = {};
......@@ -40,6 +41,19 @@ export const req2fwd = async (requirements:any, toHost:string, toPort:number, lo
} catch (e) {
logger.warn('Rejected idty %s...', idty.uid, e);
}
if (idty.revocation_sig) {
logger.info('New revocation %s', idty.uid);
const revocation = rawer.getOfficialRevocation({
currency: 'g1', // TODO: generalize
uid: idty.uid,
issuer: idty.pubkey,
buid: idty.meta.timestamp,
sig: idty.sig,
revocation: idty.revocation_sig
})
await targetPeer.postRevocation(revocation);
}
}
for (const received of idty.pendingCerts) {
const cid = [received.from, iid].join('-');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment