Transaction: use stream in hasWitnesses()

This commit is contained in:
Sean Gilligan 2023-04-16 19:38:33 -07:00 committed by Andreas Schildbach
parent ab08261ef2
commit 3f3f9bb636

View file

@ -662,10 +662,7 @@ public class Transaction extends BaseMessage {
/** @return true of the transaction has any witnesses in any of its inputs */ /** @return true of the transaction has any witnesses in any of its inputs */
public boolean hasWitnesses() { public boolean hasWitnesses() {
for (TransactionInput in : inputs) return inputs.stream().anyMatch(TransactionInput::hasWitness);
if (in.hasWitness())
return true;
return false;
} }
/** /**