mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 18:16:45 +00:00
Tx inputs and outputs can find their index
This commit is contained in:
parent
0340f06de4
commit
566aa2e953
2 changed files with 10 additions and 0 deletions
|
@ -82,6 +82,11 @@ public class TransactionInput extends TransactionPart {
|
||||||
this.sequence = sequence;
|
this.sequence = sequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
Transaction transaction = (Transaction)parent;
|
||||||
|
return transaction.getInputs().indexOf(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true.
|
* Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -77,4 +77,9 @@ public class TransactionOutput extends TransactionPart {
|
||||||
public void setAddresses(Address[] addresses) {
|
public void setAddresses(Address[] addresses) {
|
||||||
this.addresses = addresses;
|
this.addresses = addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
Transaction transaction = (Transaction)parent;
|
||||||
|
return transaction.getOutputs().indexOf(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue