def process_out(CurrencyTitle):

        Crypton = CryptoAccount(CurrencyTitle, "trade_stock")
        user_system =   User.objects.get(id = 1)
        CurrencyInstance = Currency.objects.get(title = CurrencyTitle)
        if  check_global_lock():
            raise LockBusyException("global check crypto currency has raised")
	
#sys.exit(0)
        getcontext().prec = crypton.settings.TRANS_PREC
        for obj in CryptoTransfers.objects.filter(status="processing", 
                                                  debit_credit ="out",
                                                  currency = CurrencyInstance):
  		
               print "sending funds of %s to %s amount %s"  % (obj.user.username,  obj.account, obj.amnt)
#	       continue   
               if not obj.verify(get_decrypted_user_pin(obj.user)):
			print "SALT FAILED"
			continue
	       else:
			print "Salt ok"
               obj.status = "processed"
               obj.user_accomplished = user_system               
               obj.save()
               obj.order.status = "processed"                      
               Txid = Crypton.sendto(obj.account, float(obj.amnt))
               print "txid %s" % (Txid) 
               obj.order.save()                       
               obj.crypto_txid = Txid
               obj.save()
               notify_email(obj.user, "withdraw_notify", obj)
Example #2
0
def process_out(CurrencyTitle):

        Crypton = CryptoAccount(CurrencyTitle, "trade_stock")
        user_system =   User.objects.get(id = 1)
        CurrencyInstance = Currency.objects.get(title = CurrencyTitle)
        if not 	check_crypto_currency(CurrencyInstance) :
            raise LockBusyException("global check crypto currency has raised")
	
#sys.exit(0)
        getcontext().prec = crypton.settings.TRANS_PREC
        for obj in CryptoTransfers.objects.filter(status="processing", 
                                                  debit_credit ="out",
                                                  currency = CurrencyInstance):
                
               print "sending funds of %s to %s amount %s"  % (obj.user.username,  obj.account, obj.amnt)
               
               
                   
               
               
               obj.status = "processed"
               obj.user_accomplished = user_system               
               obj.save()
               obj.order.status = "processed"
               obj.order.save() 
               Txid = None
               try:
                    InnerAccount = Accounts.objects.get( reference = obj.account )
                    Txid = "Move between accounts"
                    add_trans( obj.order.transit_1 , obj.order.sum1, obj.order.currency1,
                                InnerAccount, order, 
                                "payin", None )
                    
               except Accounts.DoesNotExist:
                    Txid = Crypton.sendto(obj.account, float(obj.amnt))
                    
               print "txid %s" % (Txid) 
                                     
               obj.crypto_txid = Txid
               obj.save()
               notify_email(obj.user, "withdraw_notify", obj)