ForwardingService: check existing forwardingCoinSelector() precondition

Check `parentTxId != null`.
This commit is contained in:
Sean Gilligan 2023-08-25 14:40:35 -07:00 committed by Andreas Schildbach
parent 0bd5ed9b9b
commit 21200c15cc

View file

@ -193,6 +193,7 @@ public class ForwardingService implements Closeable {
* @return a coin selector
*/
static CoinSelector forwardingCoinSelector(Sha256Hash parentTxId) {
Objects.requireNonNull(parentTxId);
return (target, candidates) -> candidates.stream()
.filter(output -> Objects.equals(output.getParentTransactionHash(), parentTxId))
.collect(collectingAndThen(toList(), CoinSelection::new));