diff --git a/core/src/main/java/com/google/bitcoin/core/Wallet.java b/core/src/main/java/com/google/bitcoin/core/Wallet.java index 9d7f92af..ee55447d 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -860,11 +860,11 @@ public class Wallet implements Serializable, BlockChainListener { private static AnalysisResult analyzeTransactionAndDependencies(Transaction tx, List dependencies) { AnalysisResult result = new AnalysisResult(); - if (tx.getLockTime() > 0) + if (tx.isTimeLocked()) result.timeLocked = tx; if (dependencies != null) { for (Transaction dep : dependencies) { - if (dep.getLockTime() > 0) { + if (dep.isTimeLocked()) { result.timeLocked = dep; } } @@ -897,7 +897,7 @@ public class Wallet implements Serializable, BlockChainListener { return false; } - if (tx.getLockTime() > 0 && !acceptTimeLockedTransactions) { + if (tx.isTimeLocked() && !acceptTimeLockedTransactions) { log.warn("Received transaction {} with a lock time of {}, but not configured to accept these, discarding", tx.getHashAsString(), tx.getLockTime()); return false; diff --git a/core/src/test/java/com/google/bitcoin/core/PeerTest.java b/core/src/test/java/com/google/bitcoin/core/PeerTest.java index d2c26013..cbddbaba 100644 --- a/core/src/test/java/com/google/bitcoin/core/PeerTest.java +++ b/core/src/test/java/com/google/bitcoin/core/PeerTest.java @@ -702,6 +702,7 @@ public class PeerTest extends TestWithNetworkConnections { // Add a fake input to t3 that goes nowhere. Sha256Hash t3 = Sha256Hash.create("abc".getBytes(Charset.forName("UTF-8"))); t2.addInput(new TransactionInput(unitTestParams, t2, new byte[]{}, new TransactionOutPoint(unitTestParams, 0, t3))); + t2.getInput(0).setSequenceNumber(0xDEADBEEF); t2.addOutput(Utils.toNanoCoins(1, 0), new ECKey()); Transaction t1 = new Transaction(unitTestParams); t1.addInput(t2.getOutput(0));