Program: 35015
Project: 35015
Buggy source:
private void rollbackUtxo(Transaction tx){
  if (tx == null) {
    return;
  }
  byte[] txHashBytes=new byte[0];
  try {
    txHashBytes=tx.getHash().serialize();
  }
 catch (  IOException e) {
    throw new NulsRuntimeException(e);
  }
  CoinData coinData=tx.getCoinData();
  if (coinData != null) {
    List<Coin> froms=coinData.getFrom();
    Map<byte[],byte[]> fromMap=new HashMap<>();
    for (    Coin from : froms) {
      byte[] fromSource=from.getOwner();
      byte[] utxoFromSource=new byte[tx.getHash().size()];
      byte[] fromIndex=new byte[fromSource.length - utxoFromSource.length];
      System.arraycopy(fromSource,0,utxoFromSource,0,tx.getHash().size());
      System.arraycopy(fromSource,tx.getHash().size(),fromIndex,0,fromIndex.length);
      Transaction sourceTx=null;
      try {
        sourceTx=ledgerService.getTx(NulsDigestData.fromDigestHex(Hex.encode(fromSource)));
      }
 catch (      Exception e) {
        continue;
      }
      byte[] address=sourceTx.getCoinData().getTo().get((int)new VarInt(fromIndex,0).value).getOwner();
      try {
        fromMap.put(org.spongycastle.util.Arrays.concatenate(address,from.getOwner()),sourceTx.getCoinData().getTo().get((int)new VarInt(fromIndex,0).value).serialize());
      }
 catch (      IOException e) {
        throw new NulsRuntimeException(e);
      }
    }
    accountLedgerStorageService.batchSaveUTXO(fromMap);
    List<Coin> tos=coinData.getTo();
    byte[] indexBytes;
    Set<byte[]> toSet=new HashSet<>();
    for (int i=0, length=tos.size(); i < length; i++) {
      try {
        byte[] outKey=org.spongycastle.util.Arrays.concatenate(tos.get(i).getOwner(),tx.getHash().serialize(),new VarInt(i).encode());
        toSet.add(outKey);
      }
 catch (      IOException e) {
        throw new NulsRuntimeException(e);
      }
    }
    accountLedgerStorageService.batchDeleteUTXO(toSet);
  }
  List<Coin> tos=tx.getCoinData().getTo();
  for (int i=0; i < tos.size(); i++) {
    Coin to=tos.get(i);
    try {
      byte[] outKey=org.spongycastle.util.Arrays.concatenate(to.getOwner(),tx.getHash().serialize(),new VarInt(i).encode());
      accountLedgerStorageService.deleteUTXO(outKey);
    }
 catch (    IOException e) {
      Log.info("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void rollbackUtxo(Transaction tx){
  if (tx == null) {
    return;
  }
  byte[] txHashBytes=new byte[0];
  try {
    txHashBytes=tx.getHash().serialize();
  }
 catch (  IOException e) {
    throw new NulsRuntimeException(e);
  }
  CoinData coinData=tx.getCoinData();
  if (coinData != null) {
    List<Coin> tos=coinData.getTo();
    byte[] indexBytes;
    Set<byte[]> toSet=new HashSet<>();
    for (int i=0, length=tos.size(); i < length; i++) {
      try {
        byte[] outKey=org.spongycastle.util.Arrays.concatenate(tos.get(i).getOwner(),tx.getHash().serialize(),new VarInt(i).encode());
        toSet.add(outKey);
      }
 catch (      IOException e) {
        throw new NulsRuntimeException(e);
      }
    }
    accountLedgerStorageService.batchDeleteUTXO(toSet);
  }
  List<Coin> tos=tx.getCoinData().getTo();
  for (int i=0; i < tos.size(); i++) {
    Coin to=tos.get(i);
    try {
      byte[] outKey=org.spongycastle.util.Arrays.concatenate(to.getOwner(),tx.getHash().serialize(),new VarInt(i).encode());
      accountLedgerStorageService.deleteUTXO(outKey);
    }
 catch (    IOException e) {
      Log.info("String_Node_Str");
    }
  }
}