URI: 
       tMerge pull request #6993 from zebra-lucky/pr_check_network - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 51455c9d9a999628a0d36d61c50e5931ceda912a
   DIR parent cb3977798ce021c5c6e821c1cc5c81f9eddfc243
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Thu,  4 Feb 2021 09:56:58 +0100
       
       Merge pull request #6993 from zebra-lucky/pr_check_network
       
       paymentrequest: check network on PaymentRequest parse
       Diffstat:
         M electrum/paymentrequest.py          |       8 +++++++-
       
       1 file changed, 7 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/electrum/paymentrequest.py b/electrum/paymentrequest.py
       t@@ -39,7 +39,7 @@ except ImportError:
            # sudo apt-get install protobuf-compiler
            sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=electrum/ --python_out=electrum/ electrum/paymentrequest.proto'")
        
       -from . import bitcoin, ecc, util, transaction, x509, rsakey
       +from . import bitcoin, constants, ecc, util, transaction, x509, rsakey
        from .util import bh2u, bfh, make_aiohttp_session
        from .invoices import OnchainInvoice
        from .crypto import sha256
       t@@ -144,6 +144,12 @@ class PaymentRequest:
                    return
                self.details = pb2.PaymentDetails()
                self.details.ParseFromString(self.data.serialized_payment_details)
       +        pr_network = self.details.network
       +        client_network = 'test' if constants.net.TESTNET else 'main'
       +        if pr_network != client_network:
       +            self.error = (f'Payment request network "{pr_network}" does not'
       +                          f' match client network "{client_network}".')
       +            return
                for o in self.details.outputs:
                    addr = transaction.get_address_from_output_script(o.script)
                    if not addr: