common/src/main/java/lighthouse/protocol/Project.java
public Transaction completeContract(Set<LHProtos.Pledge> pledges) {
        Transaction contract = new Transaction(params);
        outputs.forEach(contract::addOutput);
        long allPledgesValue = pledges.stream().mapToLong(pledge -> pledge.getPledgeDetails().getTotalInputValue()).sum();
        if (allPledgesValue != goalAmount)
            throw new Ex.ValueMismatch(allPledgesValue - goalAmount);
        pledges.stream().map(this::fastSanityCheck).forEach(pledge -> {
            pledge.getInputs().forEach(contract::addInput);
        });
        contract.setPurpose(Transaction.Purpose.ASSURANCE_CONTRACT_CLAIM);
        contract.verify();
        return contract;
    }
/**
     * Returns a Transaction that combines the given pledges together. No fee is included.
     *
     * @throws lighthouse.protocol.Ex.ValueMismatch if the pledges don't total to an exact match for the goal.
     */
Returns a Transaction that combines the given pledges together. No fee is included.
@throws lighthouse.protocol.Ex.ValueMismatch if the pledges don't total to an exact match for the goal.
Returns a Transaction that combines the given pledges together . No fee is included . @throws lighthouse . protocol . Ex . ValueMismatch if the pledges don ' t total to an exact match for the goal .
public Transaction completeContract(Set<LHProtos.Pledge> pledges) {
        Transaction contract = new Transaction(params);
        outputs.forEach(contract::addOutput);
        long allPledgesValue = pledges.stream().mapToLong(pledge -> pledge.getPledgeDetails().getTotalInputValue()).sum();
        if (allPledgesValue != goalAmount)
            throw new Ex.ValueMismatch(allPledgesValue - goalAmount);
        pledges.stream().map(this::fastSanityCheck).forEach(pledge -> {
            pledge.getInputs().forEach(contract::addInput);
        });
        contract.setPurpose(Transaction.Purpose.ASSURANCE_CONTRACT_CLAIM);
        contract.verify();
        return contract;
    }
public Transaction completeContract ( Set < LHProtos . Pledge > pledges ) { Transaction contract = new Transaction ( params ) ; outputs . forEach ( contract :: addOutput ) ; long allPledgesValue = pledges . stream ( ) . mapToLong ( pledge -> pledge . getPledgeDetails ( ) . getTotalInputValue ( ) ) . sum ( ) ; if ( allPledgesValue != goalAmount ) throw new Ex . ValueMismatch ( allPledgesValue - goalAmount ) ; pledges . stream ( ) . map ( this :: fastSanityCheck ) . forEach ( pledge -> { pledge . getInputs ( ) . forEach ( contract :: addInput ) ; } ) ; contract . setPurpose ( Transaction . Purpose . ASSURANCE_CONTRACT_CLAIM ) ; contract . verify ( ) ; return contract ; }
Returns a Transaction that combines the given pledges together.
Returns a Transaction that combines the given pledges together .