mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-30 23:02:15 +00:00
Add some convenience getters to a couple of classes.
This commit is contained in:
parent
9382ee15e9
commit
ee715a5f59
@ -47,4 +47,12 @@ public class GetDataMessage extends ListMessage {
|
||||
public GetDataMessage(NetworkParameters params) {
|
||||
super(params);
|
||||
}
|
||||
|
||||
public void addTransaction(Sha256Hash hash) {
|
||||
addItem(new InventoryItem(InventoryItem.Type.Transaction, hash));
|
||||
}
|
||||
|
||||
public void addBlock(Sha256Hash hash) {
|
||||
addItem(new InventoryItem(InventoryItem.Type.Block, hash));
|
||||
}
|
||||
}
|
||||
|
@ -941,6 +941,17 @@ public class Transaction extends ChildMessage implements Serializable {
|
||||
maybeParse();
|
||||
return Collections.unmodifiableList(outputs);
|
||||
}
|
||||
|
||||
/** @return the given transaction: same as getInputs().get(index). */
|
||||
public TransactionInput getInput(int index) {
|
||||
maybeParse();
|
||||
return inputs.get(index);
|
||||
}
|
||||
|
||||
public TransactionOutput getOutput(int index) {
|
||||
maybeParse();
|
||||
return outputs.get(index);
|
||||
}
|
||||
|
||||
public synchronized TransactionConfidence getConfidence() {
|
||||
if (confidence == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user