Package org.bitcoinj.protocols.payments

Examples of org.bitcoinj.protocols.payments.PaymentSession


    public Project(LHProtos.Project proto) throws PaymentProtocolException, InvalidProtocolBufferException {
        hash = Sha256Hash.create(proto.toByteArray());
        // "Cast" it to a regular BIP70 payment request, possibly losing data along the way, but that's OK
        // because we only want to do this to reuse the existing APIs.
        Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.parseFrom(proto.toByteString());
        PaymentSession session = new PaymentSession(paymentRequest, false);
        this.outputs = ImmutableList.copyOf(session.getSendRequest().tx.getOutputs());
        this.params = session.getNetworkParameters();
        this.projectReq = LHProtos.ProjectDetails.parseFrom(proto.getSerializedPaymentDetails());
        this.goalAmount = this.projectReq.getOutputsList().stream().mapToLong(LHProtos.Output::getAmount).sum();
        this.minPledgeAmount = this.projectReq.getExtraDetails().getMinPledgeSize();
        if (this.goalAmount <= 0)
            throw new Ex.ValueMismatch(this.goalAmount);
View Full Code Here

TOP

Related Classes of org.bitcoinj.protocols.payments.PaymentSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.