} catch (IOException e) {
throw new RuntimeException(e); // Cannot happen.
}
scriptPubKey.write(OP_EQUAL);
Coin lastOutputValue = out11.value.subtract(SATOSHI);
TransactionOutPoint lastOutPoint;
{
Transaction tx = new Transaction(params);
tx.addOutput(new TransactionOutput(params, tx, SATOSHI, scriptPubKey.toByteArray()));
tx.addOutput(new TransactionOutput(params, tx, lastOutputValue, new byte[]{OP_1}));
addOnlyInputToTransaction(tx, out11);
lastOutPoint = new TransactionOutPoint(params, 1, tx.getHash());
b39.addTransaction(tx);
}
b39numP2SHOutputs++;
while (b39.getMessageSize() < Block.MAX_BLOCK_SIZE)
{
Transaction tx = new Transaction(params);
lastOutputValue = lastOutputValue.subtract(SATOSHI);
tx.addOutput(new TransactionOutput(params, tx, SATOSHI, scriptPubKey.toByteArray()));
tx.addOutput(new TransactionOutput(params, tx, lastOutputValue, new byte[]{OP_1}));
tx.addInput(new TransactionInput(params, tx, new byte[]{OP_1}, lastOutPoint));
lastOutPoint = new TransactionOutPoint(params, 1, tx.getHash());