mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
BtcWalletService.getFreshAddressEntry(): code clean up
This commit is contained in:
parent
b9e404f0e2
commit
5524ba3e97
@ -614,7 +614,12 @@ public class BtcWalletService extends WalletService {
|
||||
Optional<AddressEntry> addressEntry = getAddressEntryListAsImmutableList().stream()
|
||||
.filter(e -> context == e.getContext())
|
||||
.filter(e -> isAddressUnused(e.getAddress()))
|
||||
.filter(e -> Script.ScriptType.P2WPKH.equals(e.getAddress().getOutputScriptType()) == segwit)
|
||||
.filter(e -> {
|
||||
boolean isSegwitOutputScriptType = Script.ScriptType.P2WPKH.equals(e.getAddress().getOutputScriptType());
|
||||
// We need to ensure that we take only addressEntries which matches our segWit flag
|
||||
boolean isMatchingOutputScriptType = isSegwitOutputScriptType == segwit;
|
||||
return isMatchingOutputScriptType;
|
||||
})
|
||||
.findAny();
|
||||
return getOrCreateAddressEntry(context, addressEntry, segwit);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user