def start(self, daemon=False):
        from PyQt4 import QtGui, QtCore
        app = QtGui.QApplication(sys.argv)
        import bitmessage_icons_rc
        splash_pix = QtGui.QPixmap(':/newPrefix/images/loading.jpg')
        splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)

        splash.setMask(splash_pix.mask())
        splash.show()
        shared.daemon = daemon

        #electrum version
        electrumon = True
        settings = shelve.open("settings.slv")
        if "electrumon" in settings.keys():
            if settings["electrumon"] == True:
                electrumon = True
                settings.close()
            else:
                settings.close()
                electrumon = False
        else:
            #settings["electrumon"] = True
            settings.close()
            splash.hide()
            import electrumfirst
            electrumfirst.run()

        if electrumon == False:
            try:
                datadir = os.getcwd()+"/btc"
                print  datadir
                db_env = DBEnv(0)
                r = db_env.open(datadir, (DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_THREAD|DB_RECOVER))
                walletname = "wallet.dat"
                fordel = shelve.open("fordel.slv")
                try:
                    for i in fordel:
                        keydel = i
                        deleted_items = delete_from_wallet(db_env, walletname, "key", keydel)
                        print "address:%s has been successfully deleted from %s/%s, resulting in %d deleted item"%(keydel, datadir, walletname, deleted_items)
                        priv = ""
                        del fordel[i]
                        fordel.sync()
                except:
                    print "can't delete addresses"
                fordel.close()
                #changes start
                process = subprocess.Popen([os.getcwd()+'/btc/bitcoin-qt.exe', "-datadir="+datadir], shell=True, creationflags=subprocess.SW_HIDE)
                print "Wait bitcoin-qt"
                time.sleep(5)
            except:
                error=""



        #changes end here
        #
        # is the application already running?  If yes then exit.
        thisapp = singleton.singleinstance()

        signal.signal(signal.SIGINT, helper_generic.signal_handler)
        # signal.signal(signal.SIGINT, signal.SIG_DFL)

        helper_bootstrap.knownNodes()
        # Start the address generation thread
        addressGeneratorThread = addressGenerator()
        addressGeneratorThread.daemon = True  # close the main program even if there are threads left
        addressGeneratorThread.start()

        # Start the thread that calculates POWs
        singleWorkerThread = singleWorker()
        singleWorkerThread.daemon = True  # close the main program even if there are threads left
        singleWorkerThread.start()

        #data_dir = os.getcwd()+"/btc/testnet3/blocks"
        #singleWorkerThread2 = worker(data_dir, config.addresses, config.days)
        #singleWorkerThread2.daemon = False
        #singleWorkerThread2.starttimer()



        # Start the SQL thread
        sqlLookup = sqlThread()
        sqlLookup.daemon = False  # DON'T close the main program even if there are threads left. The closeEvent should command this thread to exit gracefully.
        sqlLookup.start()

        # Start the thread that calculates POWs
        objectProcessorThread = objectProcessor()
        objectProcessorThread.daemon = False  # DON'T close the main program even the thread remains. This thread checks the shutdown variable after processing each object.
        objectProcessorThread.start()

        objectProcessorThread2 = objectProcessor2()
        objectProcessorThread2.daemon = False  # DON'T close the main program even the thread remains. This thread checks the shutdown variable after processing each object.
        objectProcessorThread2.start()

        # Start the cleanerThread
        singleCleanerThread = singleCleaner()
        singleCleanerThread.daemon = True  # close the main program even if there are threads left
        singleCleanerThread.start()
        shared.reloadMyAddressHashes()
        shared.reloadBroadcastSendersForWhichImWatching()


        if shared.safeConfigGetBoolean('bitmessagesettings', 'apienabled'):
            try:
                apiNotifyPath = shared.config.get(
                    'bitmessagesettings', 'apinotifypath')
            except:
                apiNotifyPath = ''
            if apiNotifyPath != '':
                with shared.printLock:
                    print 'Trying to call', apiNotifyPath

                call([apiNotifyPath, "startingUp"])
            singleAPIThread = singleAPI()
            singleAPIThread.daemon = True  # close the main program even if there are threads left
            singleAPIThread.start()

        connectToStream(1)

        singleListenerThread = singleListener()
        singleListenerThread.setup(selfInitiatedConnections)
        singleListenerThread.daemon = True  # close the main program even if there are threads left
        singleListenerThread.start()

        if daemon == False and shared.safeConfigGetBoolean('bitmessagesettings', 'daemon') == False:
            try:
                from PyQt4 import QtCore, QtGui
            except Exception as err:
                print 'PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download PyQt from http://www.riverbankcomputing.com/software/pyqt/download   or by searching Google for \'PyQt Download\'. If you want to run in daemon mode, see https://bitmessage.org/wiki/Daemon'
                print 'Error message:', err
                try:
                    process.kill()
                except:
                    pass
                os._exit(0)

            import bitmessageqt
            splash.close()
            bitmessageqt.run()




        else:
            shared.config.remove_option('bitmessagesettings', 'dontconnect')

            if daemon:
                with shared.printLock:
                    print 'Running as a daemon. The main program should exit this thread.'
            else:
                with shared.printLock:
                    print 'Running as a daemon. You can use Ctrl+C to exit.'
                while True:
                    time.sleep(20)
dataset/ETHPy150Open bitxbay/BitXBay/BitXBay.py/Main.start/original