コード例 #1
0
        created = post_list[authorperm]["created"]
        if (datetime.utcnow() - created).total_seconds() > 3 * 24 * 60 * 60:
            continue
        if (start_timestamp > created):
            continue
        author = post_list[authorperm]["author"]
        if author not in member_accounts:
            continue
        if upvote_counter[author] > 0:
            continue
        if post_list[authorperm]["main_post"] == 0 and (
                datetime.utcnow() -
                created).total_seconds() > comment_vote_timeout_h * 60 * 60:
            postTrx.update_comment_to_old(author, created, True)

        member = Member(memberStorage.get(author))
        if member["comment_upvote"] == 0 and post_list[authorperm][
                "main_post"] == 0:
            continue
        if member["blacklisted"]:
            continue
        elif member["blacklisted"] is None and (member["steemcleaners"]
                                                or member["buildawhale"]):
            continue

        rshares = member["balance_rshares"] / comment_vote_divider
        if post_list[authorperm][
                "main_post"] == 1 and rshares < minimum_vote_threshold:
            continue
        elif post_list[authorperm][
                "main_post"] == 0 and rshares < minimum_vote_threshold * 2:
コード例 #2
0
        current_cycle = last_cycle + timedelta(seconds=60 * share_cycle_min)

        print("Update member database, new cycle: %s" % str(new_cycle))
        # memberStorage.wipe(True)
        member_accounts = memberStorage.get_all_accounts()

        #print(key_list)
        nodes = NodeList()
        nodes.update_nodes()
        stm = Steem(node=nodes.get_nodes())

        member_data = {}
        n_records = 0
        share_age_member = {}
        for m in member_accounts:
            member_data[m] = Member(memberStorage.get(m))

        if True:
            print("reward voted steembasicincome post and comments")
            # account = Account("steembasicincome", steem_instance=stm)

            if last_paid_post is None:
                last_paid_post = datetime(2018, 8, 9, 3, 36, 48)
            new_paid_post = last_paid_post
            if last_paid_comment is None:
                last_paid_comment = datetime(2018, 8, 9, 3, 36, 48)
            # elif (datetime.utcnow() - last_paid_comment).total_seconds() / 60 / 60 / 24 < 6.5:
            #    last_paid_comment = datetime.utcnow() - timedelta(days=7)
            new_paid_comment = last_paid_comment

            for account in accounts:
コード例 #3
0
    except:
        print("could not update nodes")    
    stm = Steem(node=nodes.get_nodes(hive=hive_blockchain))    


    # Update current node list from @fullnodeupdate
    print("check member database")
    # memberStorage.wipe(True)
    member_accounts = memberStorage.get_all_accounts()
    data = trxStorage.get_all_data()
    
    missing_accounts = []
    member_data = {}
    aborted = False
    for m in member_accounts:
        member_data[m] = memberStorage.get(m)
    # Check wrong account names:
    if False:
        cnt = 0
        for m in member_accounts:
            if aborted:
                continue
            cnt += 1
            if cnt % 100 == 0:
                print("%d/%d scanned" % ())
            try:
                acc = Account(m, steem_instance=stm)
            except KeyboardInterrupt:
                aborted = True
            except:
                print("%s is not a valid account" % m)