Created
February 1, 2018 09:18
-
-
Save xeroc/af7cb3e9428ed64353ef9583c3d80faa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import pika | |
import sys | |
import json | |
import config | |
from piston.account import Account | |
from .models import User | |
from .maillog import logmodule | |
from .operationsqueue import OperationsQueue | |
log = logmodule(__name__) | |
class Worker(OperationsQueue): | |
def process(self, op): | |
########################## | |
# For account verification | |
########################## | |
if (op["type"] == "transfer" and | |
op.get("to") == config.steem_account): | |
log.info("Processing Account Verification on block %d" % op["block_num"]) | |
account_name = op["from"] | |
user = User.query.filter_by( | |
steem_account=account_name, | |
steem_confirm_code=op["memo"].strip().lower() | |
).first() | |
if user: | |
user.confirmSteem() | |
self.updateStatus(op["block_num"]) | |
def run(begin=None, end=None): | |
worker = Worker( | |
"account.verify", | |
["transfer"] | |
) | |
worker.start(begin, end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment