mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 07:12:17 +00:00
Make isCoinBase() equivalent to the reference one.
This commit is contained in:
parent
2aaa601293
commit
ca1466e628
@ -518,7 +518,7 @@ public class Transaction extends ChildMessage implements Serializable {
|
||||
*/
|
||||
public boolean isCoinBase() {
|
||||
maybeParse();
|
||||
return inputs.get(0).isCoinBase();
|
||||
return inputs.size() == 1 && inputs.get(0).isCoinBase();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ public class TransactionInput extends ChildMessage implements Serializable {
|
||||
TransactionInput(NetworkParameters params, Transaction parentTransaction, byte[] scriptBytes) {
|
||||
super(params);
|
||||
this.scriptBytes = scriptBytes;
|
||||
this.outpoint = new TransactionOutPoint(params, -1, (Transaction)null);
|
||||
this.outpoint = new TransactionOutPoint(params, NO_SEQUENCE, (Transaction)null);
|
||||
this.sequence = NO_SEQUENCE;
|
||||
this.parentTransaction = parentTransaction;
|
||||
|
||||
@ -148,7 +148,8 @@ public class TransactionInput extends ChildMessage implements Serializable {
|
||||
*/
|
||||
public boolean isCoinBase() {
|
||||
maybeParse();
|
||||
return outpoint.getHash().equals(Sha256Hash.ZERO_HASH);
|
||||
return outpoint.getHash().equals(Sha256Hash.ZERO_HASH) &&
|
||||
outpoint.getIndex() == NO_SEQUENCE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user