本文整理汇总了Java中org.bitcoinj.core.TransactionOutPoint.getIndex方法的典型用法代码示例。如果您正苦于以下问题:Java TransactionOutPoint.getIndex方法的具体用法?Java TransactionOutPoint.getIndex怎么用?Java TransactionOutPoint.getIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bitcoinj.core.TransactionOutPoint
的用法示例。
在下文中一共展示了TransactionOutPoint.getIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putTxOutSpents
import org.bitcoinj.core.TransactionOutPoint; //导入方法依赖的package包/类
public void putTxOutSpents(Transaction tx)
{
LinkedList<String> tx_outs = new LinkedList<String>();
for(TransactionInput in : tx.getInputs())
{
if (!in.isCoinBase())
{
TransactionOutPoint out = in.getOutpoint();
String key = out.getHash().toString() + ":" + out.getIndex();
//file_db.addTxOutSpentByMap(key, tx.getHash());
tx_outs.add(key);
}
}
}
示例2: getValueSent
import org.bitcoinj.core.TransactionOutPoint; //导入方法依赖的package包/类
public Value getValueSent(TransactionWatcherWallet wallet) {
if (isTrimmed) {
return getValueSent();
} else {
tx.ensureParsed();
// Find the value of the inputs that draw value from the wallet
Value sent = type.value(0);
Map<Sha256Hash, BitTransaction> transactions = wallet.getTransactions();
for (TransactionInput input : tx.getInputs()) {
TransactionOutPoint outPoint = input.getOutpoint();
// This input is taking value from a transaction in our wallet. To discover the value,
// we must find the connected transaction.
OutPointOutput connected = wallet.getUnspentTxOutput(outPoint);
if (connected == null) {
BitTransaction spendingTx = transactions.get(outPoint.getHash());
int index = (int) outPoint.getIndex();
if (spendingTx != null && spendingTx.isOutputAvailable(index)) {
connected = new OutPointOutput(spendingTx, index);
}
}
if (connected == null)
continue;
// The connected output may be the change to the sender of a previous input sent to this wallet. In this
// case we ignore it.
if (!connected.getOutput().isMineOrWatched(wallet))
continue;
sent = sent.add(connected.getValue());
}
return sent;
}
}
示例3: UnspentTx
import org.bitcoinj.core.TransactionOutPoint; //导入方法依赖的package包/类
public UnspentTx(TransactionOutPoint txop, long value, int height) {
super(txop, height);
this.txPos = (int) txop.getIndex();
this.value = value;
}
示例4: get
import org.bitcoinj.core.TransactionOutPoint; //导入方法依赖的package包/类
public static TrimmedOutPoint get(TransactionOutPoint outPoint) {
return new TrimmedOutPoint(outPoint.getParams(), outPoint.getIndex(), outPoint.getHash());
}
示例5: OutPointOutput
import org.bitcoinj.core.TransactionOutPoint; //导入方法依赖的package包/类
public OutPointOutput(TransactionOutPoint outPoint, TransactionOutput output,
boolean isGenerated) {
this(new TrimmedOutput(output, outPoint.getIndex(), outPoint.getHash()), isGenerated);
}