mirror of
https://github.com/sparrowwallet/drongo.git
synced 2025-01-30 17:11:10 +00:00
is locktime enabled check
This commit is contained in:
parent
8c4e6f4ac8
commit
1a0880dde7
2 changed files with 14 additions and 0 deletions
|
@ -53,6 +53,18 @@ public class Transaction extends TransactionPart {
|
||||||
this.lockTime = lockTime;
|
this.lockTime = lockTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLockTimeEnabled() {
|
||||||
|
if(lockTime == 0) return false;
|
||||||
|
|
||||||
|
for(TransactionInput input : inputs) {
|
||||||
|
if(input.getSequenceNumber() != TransactionInput.SEQUENCE_LOCKTIME_DISABLED) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public Sha256Hash getTxId() {
|
public Sha256Hash getTxId() {
|
||||||
if (cachedTxId == null) {
|
if (cachedTxId == null) {
|
||||||
if (!hasWitnesses() && cachedWTxId != null) {
|
if (!hasWitnesses() && cachedWTxId != null) {
|
||||||
|
|
|
@ -6,6 +6,8 @@ import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
public class TransactionInput extends TransactionPart {
|
public class TransactionInput extends TransactionPart {
|
||||||
|
public static final long SEQUENCE_LOCKTIME_DISABLED = 0xFFFFFFFF;
|
||||||
|
|
||||||
// Allows for altering transactions after they were broadcast. Values below NO_SEQUENCE-1 mean it can be altered.
|
// Allows for altering transactions after they were broadcast. Values below NO_SEQUENCE-1 mean it can be altered.
|
||||||
private long sequence;
|
private long sequence;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue