common/src/main/java/lighthouse/protocol/Project.java
public Transaction fastSanityCheck(LHProtos.Pledge pledge) {
        if (pledge.getTransactionsList().isEmpty())
            throw new Ex.NoTransactionData();
        // We take the last the transaction because the others are dependencies.
        Transaction tx = LHUtils.pledgeToTx(params, pledge);
        if (tx.getOutputs().size() != outputs.size())
            throw new Ex.TxWrongNumberOfOutputs(tx.getOutputs().size(), outputs.size());
        // Output scripts must match project output scripts. We assume the project creator doesn't specify an invalid
        // or non-standard output: we could check for that later, however.
        for (int i = 0; i < tx.getOutputs().size(); i++) {
            if (!outputs.get(i).duplicateDetached().equals(tx.getOutput(i).duplicateDetached()))
                throw new Ex.OutputMismatch();
        }
        tx.verify();
        return tx;
    }
/** Check that the pledge protobuf passes basic validity checks. */
Check that the pledge protobuf passes basic validity checks.
Check that the pledge protobuf passes basic validity checks .
public Transaction fastSanityCheck(LHProtos.Pledge pledge) {
        if (pledge.getTransactionsList().isEmpty())
            throw new Ex.NoTransactionData();
        Transaction tx = LHUtils.pledgeToTx(params, pledge);
        if (tx.getOutputs().size() != outputs.size())
            throw new Ex.TxWrongNumberOfOutputs(tx.getOutputs().size(), outputs.size());
        for (int i = 0; i < tx.getOutputs().size(); i++) {
            if (!outputs.get(i).duplicateDetached().equals(tx.getOutput(i).duplicateDetached()))
                throw new Ex.OutputMismatch();
        }
        tx.verify();
        return tx;
    }
public Transaction fastSanityCheck ( LHProtos . Pledge pledge ) { if ( pledge . getTransactionsList ( ) . isEmpty ( ) ) throw new Ex . NoTransactionData ( ) ; Transaction tx = LHUtils . pledgeToTx ( params , pledge ) ; if ( tx . getOutputs ( ) . size ( ) != outputs . size ( ) ) throw new Ex . TxWrongNumberOfOutputs ( tx . getOutputs ( ) . size ( ) , outputs . size ( ) ) ; for ( int i = 0 ; i < tx . getOutputs ( ) . size ( ) ; i ++ ) { if ( ! outputs . get ( i ) . duplicateDetached ( ) . equals ( tx . getOutput ( i ) . duplicateDetached ( ) ) ) throw new Ex . OutputMismatch ( ) ; } tx . verify ( ) ; return tx ; }
Check that the pledge protobuf passes basic validity checks.
Check that the pledge protobuf passes basic validity checks .
// We take the last the transaction because the others are dependencies. // Output scripts must match project output scripts. We assume the project creator doesn't specify an invalid // or non-standard output: we could check for that later, however.