[bisq-network/bisq] Wallet changes for Segwit BSQ implementation (#5109)

chimp1984 notifications at github.com
Thu Jan 28 22:40:45 CET 2021


@chimp1984 approved this pull request.

utACK

Looks all good to me. 

The Base58AddressValidator is still used in MockTestnetCoin. I think that can be replaced with BitcoinAddressValidator now.


> @@ -416,7 +416,9 @@ private void initWallet() {
                 requestWalletPasswordHandler.accept(aesKey -> {
                     walletsManager.setAesKey(aesKey);
                     walletsSetup.getWalletConfig().maybeAddSegwitKeychain(walletsSetup.getWalletConfig().btcWallet(),
-                            aesKey);
+                            aesKey, false);
+                    walletsSetup.getWalletConfig().maybeAddSegwitKeychain(walletsSetup.getWalletConfig().bsqWallet(),

Maybe we can handle that in walletsManager, which is used for operations which should be applied to both wallets, so it is closer to the wallet domain.

>          return getUnusedAddress();
     }
 
-    public LegacyAddress getUnusedAddress() {
-        return (LegacyAddress) wallet.getIssuedReceiveAddresses().stream()
+    public Address getUnusedAddress() {
+        return wallet.getIssuedReceiveAddresses().stream()
+                .filter(address -> Script.ScriptType.P2WPKH.equals(address.getOutputScriptType()))

So we enforce a new segwit address in case a unused legacy address would be available. Just want to double check that this was your intention. I agree that this makes sense so no old dangling legacy addresses will be used. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5109#pullrequestreview-578746098
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210128/ab23a561/attachment.htm>


More information about the bisq-github mailing list