From 119d26fda2ffb36c66559a1f06470b499cd73312 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Sat, 26 Apr 2014 00:32:23 +0200 Subject: [PATCH] Fix crash --- core/src/main/java/com/google/bitcoin/core/Wallet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 2df5d65f..db6c23cb 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -3450,8 +3450,8 @@ public class Wallet implements Serializable, BlockChainListener, PeerFilterProvi // Of the coins we could spend, pick some that we actually will spend. CoinSelector selector = req.coinSelector == null ? coinSelector : req.coinSelector; - CoinSelection selection = selector.select(valueNeeded, candidates); - candidates = null; // Selector took ownership and might have changed candidates. Don't access again. + // selector is allowed to modify candidates list. + CoinSelection selection = selector.select(valueNeeded, new LinkedList(candidates)); // Can we afford this? if (selection.valueGathered.compareTo(valueNeeded) < 0) { valueMissing = valueNeeded.subtract(selection.valueGathered);