From a724bcada57280830291eb4904b10e442901f81d Mon Sep 17 00:00:00 2001
From: Matt Corallo
Date: Thu, 11 Jul 2013 14:20:23 +0200
Subject: [PATCH] Mark receivePending(List dependencies) @Nullable
---
core/src/main/java/com/google/bitcoin/core/Wallet.java | 2 +-
.../bitcoin/protocols/channels/PaymentChannelServerState.java | 2 +-
core/src/test/java/com/google/bitcoin/core/TestWithWallet.java | 2 +-
.../com/google/bitcoin/store/WalletProtobufSerializerTest.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
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 aea7a0b79..18c0ba6ac 100644
--- a/core/src/main/java/com/google/bitcoin/core/Wallet.java
+++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java
@@ -713,7 +713,7 @@ public class Wallet implements Serializable, BlockChainListener, PeerFilterProvi
* called to decide whether the wallet cares about the transaction - if it does, then this method expects the
* transaction and any dependencies it has which are still in the memory pool.
*/
- public void receivePending(Transaction tx, List dependencies) throws VerificationException {
+ public void receivePending(Transaction tx, @Nullable List dependencies) throws VerificationException {
receivePending(tx, dependencies, false);
}
diff --git a/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java b/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java
index 776717d8e..ac9e2bc91 100644
--- a/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java
+++ b/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java
@@ -244,7 +244,7 @@ public class PaymentChannelServerState {
try {
// Manually add the multisigContract to the wallet, overriding the isRelevant checks so we can track
// it and check for double-spends later
- wallet.receivePending(multisigContract, Collections.EMPTY_LIST, true);
+ wallet.receivePending(multisigContract, null, true);
} catch (VerificationException e) {
throw new RuntimeException(e); // Cannot happen, we already called multisigContract.verify()
}
diff --git a/core/src/test/java/com/google/bitcoin/core/TestWithWallet.java b/core/src/test/java/com/google/bitcoin/core/TestWithWallet.java
index 8bed75eb8..31bfd4be8 100644
--- a/core/src/test/java/com/google/bitcoin/core/TestWithWallet.java
+++ b/core/src/test/java/com/google/bitcoin/core/TestWithWallet.java
@@ -60,7 +60,7 @@ public class TestWithWallet {
if (type == null) {
// Pending/broadcast tx.
if (wallet.isPendingTransactionRelevant(tx))
- wallet.receivePending(tx, new ArrayList());
+ wallet.receivePending(tx, null);
} else {
TestUtils.BlockPair bp = createFakeBlock(blockStore, tx);
wallet.receiveFromBlock(tx, bp.storedBlock, type);
diff --git a/core/src/test/java/com/google/bitcoin/store/WalletProtobufSerializerTest.java b/core/src/test/java/com/google/bitcoin/store/WalletProtobufSerializerTest.java
index 1a20afd8c..60db8fce3 100644
--- a/core/src/test/java/com/google/bitcoin/store/WalletProtobufSerializerTest.java
+++ b/core/src/test/java/com/google/bitcoin/store/WalletProtobufSerializerTest.java
@@ -65,7 +65,7 @@ public class WalletProtobufSerializerTest {
t1.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("1.2.3.4")));
t1.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("5.6.7.8")));
t1.getConfidence().setSource(TransactionConfidence.Source.NETWORK);
- myWallet.receivePending(t1, new ArrayList());
+ myWallet.receivePending(t1, null);
Wallet wallet1 = roundTrip(myWallet);
assertEquals(1, wallet1.getTransactions(true).size());
assertEquals(v1, wallet1.getBalance(Wallet.BalanceType.ESTIMATED));