3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

Fix the Wallet unit tests by allowing null blocks in Wallet.receive() again.

This commit is contained in:
Mike Hearn 2011-09-18 20:01:57 +00:00
parent 42b5a0d0ed
commit 6f36e96f66

View File

@ -245,6 +245,7 @@ public class Wallet implements Serializable {
// accepted by the network. // accepted by the network.
// //
// Mark the tx as appearing in this block so we can find it later after a re-org. // Mark the tx as appearing in this block so we can find it later after a re-org.
if (block != null)
wtx.addBlockAppearance(block, bestChain); wtx.addBlockAppearance(block, bestChain);
if (bestChain) { if (bestChain) {
if (valueSentToMe.equals(BigInteger.ZERO)) { if (valueSentToMe.equals(BigInteger.ZERO)) {
@ -277,6 +278,7 @@ public class Wallet implements Serializable {
} else { } else {
if (!reorg) { if (!reorg) {
// Mark the tx as appearing in this block so we can find it later after a re-org. // Mark the tx as appearing in this block so we can find it later after a re-org.
if (block != null)
tx.addBlockAppearance(block, bestChain); tx.addBlockAppearance(block, bestChain);
} }
// This TX didn't originate with us. It could be sending us coins and also spending our own coins if keys // This TX didn't originate with us. It could be sending us coins and also spending our own coins if keys