mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 17:26:28 +01:00
ForwardingService: make use of null-safe Objects.equals()
This commit is contained in:
parent
111a8b8a37
commit
0bd5ed9b9b
1 changed files with 2 additions and 1 deletions
|
@ -34,6 +34,7 @@ import org.bitcoinj.wallet.listeners.WalletCoinsReceivedEventListener;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import static java.util.stream.Collectors.collectingAndThen;
|
import static java.util.stream.Collectors.collectingAndThen;
|
||||||
|
@ -193,7 +194,7 @@ public class ForwardingService implements Closeable {
|
||||||
*/
|
*/
|
||||||
static CoinSelector forwardingCoinSelector(Sha256Hash parentTxId) {
|
static CoinSelector forwardingCoinSelector(Sha256Hash parentTxId) {
|
||||||
return (target, candidates) -> candidates.stream()
|
return (target, candidates) -> candidates.stream()
|
||||||
.filter(output -> output.getParentTransactionHash() != null && output.getParentTransactionHash().equals(parentTxId))
|
.filter(output -> Objects.equals(output.getParentTransactionHash(), parentTxId))
|
||||||
.collect(collectingAndThen(toList(), CoinSelection::new));
|
.collect(collectingAndThen(toList(), CoinSelection::new));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue