public RawTransactionInfo(Transaction transaction) {
this.hex = TransactionHexSerializer.bytesToHexString(transaction.bitcoinSerialize());
this.txid = transaction.getHash();
this.version = transaction.getVersion();
this.locktime = transaction.getLockTime();
this.blockhash = null;
this.confirmations = transaction.getConfidence().getDepthInBlocks();
this.time = 0;
this.blocktime = this.time;
vin = new VinList();
for (TransactionInput input : transaction.getInputs()) {
vin.add(new Vin(txid,
input.getOutpoint().getIndex(),
input.getScriptSig().toString(),
input.getSequenceNumber()));
}
vout = new VoutList();
for (TransactionOutput output : transaction.getOutputs()) {
vout.add(new Vout(output.getValue(),
output.getIndex(),
output.getScriptPubKey().toString()));
}
}