3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 07:12:17 +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,7 +245,8 @@ public class Wallet implements Serializable {
// accepted by the network.
//
// Mark the tx as appearing in this block so we can find it later after a re-org.
wtx.addBlockAppearance(block, bestChain);
if (block != null)
wtx.addBlockAppearance(block, bestChain);
if (bestChain) {
if (valueSentToMe.equals(BigInteger.ZERO)) {
// There were no change transactions so this tx is fully spent.
@ -277,7 +278,8 @@ public class Wallet implements Serializable {
} else {
if (!reorg) {
// Mark the tx as appearing in this block so we can find it later after a re-org.
tx.addBlockAppearance(block, bestChain);
if (block != null)
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
// are being shared between different wallets.