if (txSize == null)
txSize = tx.getMessageSize();
final long requiredFeeDelta = txSize + tx.getInputs().size() * 4;
final List<TransactionInput> oldInputs = new ArrayList<>(tx.getInputs());
tx.clearInputs();
<BUG>for (int i = 0; i < txItem.eps.size(); ++i) {
final Map<String, Object> ep = (Map) txItem.eps.get(i);
if (((Boolean) ep.get("is_credit"))) continue;
final TransactionInput oldInput = oldInputs.get((Integer) ep.get("pt_idx"));
</BUG>
final TransactionInput newInput = new TransactionInput(

if (txSize == null)
txSize = tx.getMessageSize();
final long requiredFeeDelta = txSize + tx.getInputs().size() * 4;
final List<TransactionInput> oldInputs = new ArrayList<>(tx.getInputs());
tx.clearInputs();
for (final JSONMap ep : txItem.eps) {
if (ep.getBool("is_credit"))
continue;
final TransactionInput oldInput = oldInputs.get(ep.getInt("pt_idx"));
final TransactionInput newInput = new TransactionInput(
