diff --git a/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java b/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java index 220971fd..4e27bfcb 100644 --- a/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java +++ b/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java @@ -478,7 +478,7 @@ public abstract class AbstractBlockChain { // is relevant to both of them, they don't end up accidentally sharing the same object (which can // result in temporary in-memory corruption during re-orgs). See bug 257. We only duplicate in // the case of multiple wallets to avoid an unnecessary efficiency hit in the common case. - sendTransactionsToListener(newBlock, NewBlockType.SIDE_CHAIN, listener, txnToNotify, first); + sendTransactionsToListener(newBlock, NewBlockType.SIDE_CHAIN, listener, txnToNotify, !first); if (filteredTxHashList != null) { for (Sha256Hash hash : filteredTxHashList) { listener.notifyTransactionIsInBlock(hash, newBlock, NewBlockType.SIDE_CHAIN); 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 fb8bedc5..fbe4d059 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -2036,8 +2036,6 @@ public class Wallet implements Serializable, BlockChainListener { // the transaction is confirmed. We deliberately won't bother notifying listeners here as there's not much // point - the user isn't interested in a confidence transition they made themselves. req.tx.getConfidence().setSource(TransactionConfidence.Source.SELF); - // TODO: Remove this - a newly completed tx isn't really pending, nothing was done with it yet. - req.tx.getConfidence().setConfidenceType(ConfidenceType.PENDING); req.completed = true; req.fee = calculatedFee; log.info(" completed {} with {} inputs", req.tx.getHashAsString(), req.tx.getInputs().size()); diff --git a/core/src/test/java/com/google/bitcoin/core/WalletTest.java b/core/src/test/java/com/google/bitcoin/core/WalletTest.java index 7ff484ad..6bdce6f0 100644 --- a/core/src/test/java/com/google/bitcoin/core/WalletTest.java +++ b/core/src/test/java/com/google/bitcoin/core/WalletTest.java @@ -206,7 +206,6 @@ public class WalletTest extends TestWithWallet { private void basicSanityChecks(Wallet wallet, Transaction t, Address fromAddress, Address destination) throws VerificationException { assertEquals("Wrong number of tx inputs", 1, t.getInputs().size()); assertEquals(fromAddress, t.getInputs().get(0).getScriptSig().getFromAddress(params)); - assertEquals(TransactionConfidence.ConfidenceType.PENDING, t.getConfidence().getConfidenceType()); assertEquals("Wrong number of tx outputs",2, t.getOutputs().size()); assertEquals(destination, t.getOutputs().get(0).getScriptPubKey().getToAddress(params)); assertEquals(wallet.getChangeAddress(), t.getOutputs().get(1).getScriptPubKey().getToAddress(params)); @@ -283,7 +282,7 @@ public class WalletTest extends TestWithWallet { assertTrue(complete); assertEquals(1, t2.getInputs().size()); assertEquals(myAddress, t2.getInputs().get(0).getScriptSig().getFromAddress(params)); - assertEquals(TransactionConfidence.ConfidenceType.PENDING, t2.getConfidence().getConfidenceType()); + assertEquals(TransactionConfidence.ConfidenceType.UNKNOWN, t2.getConfidence().getConfidenceType()); // We have NOT proven that the signature is correct! wallet.commitTx(t2);