public void getcommit(ucommit ucom, user u) { vtb.AppendText("Commitment request received from " + u.name + "! \n"); if (ucom.getD() < ucom.getcert().getexp()) if (verifyuser(ucom)) if (verifycert(ucom.getcert())) { vtb.AppendText("\tCommitment approved, message sent ! \n"); trust = true; ucomm = ucom; lastpay = new payment(ucom.getc0(),0); u.comconfirm(true, this); if (!(cycleth.IsAlive == true)) cycleth.Start(); } else { vtb.AppendText("\tCertificate Signature Invalid, message sent ! \n"); u.comconfirm(false, this); } else { vtb.AppendText("\tUser Signature Invalid, message sent ! \n"); u.comconfirm(false, this); } else { vtb.AppendText("\tCertificate expired, message sent ! \n"); u.comconfirm(false, this); } }
public void getpayment(payment pay, user u) { int i = pay.geti(); BigInteger temp = pay.getci(); vtb.AppendText("Received payment of " + i + "$ from user: "******" !\n"); for (int j = i; j > 0; j--) temp = hashf.hash(temp.ToString()); if (temp == lastpay.getci()) { i += lastpay.geti(); lastpay = new payment(pay.getci(), i); vtb.AppendText("\tPayment approved, message sent !\n"); u.payconfirm(true, this,0); } else { vtb.AppendText("\tPayment failed, message sent !\n"); u.payconfirm(false, this,i); } }
public redmess(payment pw, ucommit ucom) { lpay = pw; ucomm = ucom; }
public void sendpayment(int pnr, vendor v) { currentpw += pnr; if (currentpw > pwnr) MessageBox.Show("Pay word limit for Today reached !"); else { payment pay = new payment(pwords[currentpw], pnr); utb.AppendText("Sent payment of " + pnr + "$ to vendor: " + v.name + " !\n"); v.getpayment(pay, this); changepw(pnr); } }