mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-11-02 18:26:43 +00:00
support blockchain ordering of txes a separate method
This commit is contained in:
parent
b7038b19f9
commit
a56f8971c0
1 changed files with 10 additions and 1 deletions
|
@ -37,6 +37,15 @@ public class BlockTransaction extends BlockTransactionHash implements Comparable
|
|||
|
||||
@Override
|
||||
public int compareTo(BlockTransaction blkTx) {
|
||||
int blockOrder = compareBlockOrder(blkTx);
|
||||
if(blockOrder != 0) {
|
||||
return blockOrder;
|
||||
}
|
||||
|
||||
return super.compareTo(blkTx);
|
||||
}
|
||||
|
||||
public int compareBlockOrder(BlockTransaction blkTx) {
|
||||
if(getHeight() != blkTx.getHeight()) {
|
||||
return getComparisonHeight() - blkTx.getComparisonHeight();
|
||||
}
|
||||
|
@ -49,7 +58,7 @@ public class BlockTransaction extends BlockTransactionHash implements Comparable
|
|||
return -1;
|
||||
}
|
||||
|
||||
return super.compareTo(blkTx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static List<HashIndex> getReferencedOutpoints(BlockTransaction blockchainTransaction) {
|
||||
|
|
Loading…
Reference in a new issue