Example #1
0
    def send_opening(self):
        peers = self.get_peers()

        countryCodes = []
        for country in pycountry.countries:
            countryCodes.append({"code": country.alpha2, "name": country.name})

        settings = self.market.get_settings()

        message = {
            'type': 'myself',
            'pubkey': settings.get('pubkey'),
            'peers': peers,
            'settings': settings,
            'guid': self.transport.guid,
            'sin': self.transport.sin,
            'uri': self.transport.uri,
            'countryCodes': countryCodes,
        }

        self.send_to_client(None, message)

        burnAddr = trust.burnaddr_from_guid(self.transport.guid)

        def found_unspent(amount):
            self.send_to_client(None, {
                'type': 'burn_info_available',
                'amount': amount,
                'addr': burnAddr
            })

        trust.get_unspent(burnAddr, found_unspent)
Example #2
0
    def send_opening(self):
        peers = self.get_peers()

        countryCodes = []
        for country in pycountry.countries:
            countryCodes.append({"code": country.alpha2, "name": country.name})

        settings = self._market.get_settings()
        # globalTrust = trust.getTrust(self._transport.guid)

        # print(trust.get(self._transport.guid))

        message = {
            'type': 'myself',
            'pubkey': settings.get('pubkey'),
            'peers': peers,
            'settings': settings,
            'guid': self._transport.guid,
            'sin': self._transport.sin,
            'uri': self._transport._uri,
            'countryCodes': countryCodes,
            # 'globalTrust': globalTrust
        }

        # print('Sending opening')
        self.send_to_client(None, message)

        burnAddr = trust.burnaddr_from_guid(self._transport.guid)
        # def found_unspent(amount_in_satoshis):

        def found_unspent(amount):
            # print("found_unspent")
            self.send_to_client(None, {
                'type': 'burn_info_available',
                'amount': amount,
                'addr': burnAddr
            })

        # print("getting unspent")

        trust.get_unspent(burnAddr, found_unspent)
Example #3
0
    def send_opening(self):
        peers = self.get_peers()

        countryCodes = []
        for country in pycountry.countries:
            countryCodes.append({"code": country.alpha2, "name": country.name})

        settings = self.market.get_settings()
        # globalTrust = trust.getTrust(self.transport.guid)

        # print(trust.get(self.transport.guid))

        message = {
            'type': 'myself',
            'pubkey': settings.get('pubkey'),
            'peers': peers,
            'settings': settings,
            'guid': self.transport.guid,
            'sin': self.transport.sin,
            'uri': self.transport.uri,
            'countryCodes': countryCodes,
            # 'globalTrust': globalTrust
        }

        # print('Sending opening')
        self.send_to_client(None, message)

        burnAddr = trust.burnaddr_from_guid(self.transport.guid)
        # def found_unspent(amount_in_satoshis):

        def found_unspent(amount):
            # print("found_unspent")
            self.send_to_client(None, {
                'type': 'burn_info_available',
                'amount': amount,
                'addr': burnAddr
            })

        # print("getting unspent")

        trust.get_unspent(burnAddr, found_unspent)