Example #1
0
        if (mngt_shares * 20) < shares_sum - 100 and not mngt_shares_assigned:
            mngt_shares_assigned = True
            mngt_shares_sum += 100
            print("add mngt shares")
            latest_share = trxStorage.get_lastest_share_type("Mgmt")
            if latest_share is not None:
                start_index = latest_share["index"] + 1
            else:
                start_index = 0
            for account in mgnt_shares:
                shares = mgnt_shares[account]
                mgmt_data = {"index": start_index, "source": "mgmt", "memo": "", "account": account, "sponsor": account, "sponsee": {}, "shares": shares, "vests": float(0), "timestamp": formatTimeString(timestamp),
                         "status": "Valid", "share_type": "Mgmt"}
                start_index += 1
                print(mgmt_data)
                trxStorage.add(mgmt_data)     

        # add bonus_shares from active delegation
        for m in member_data:
            if m in delegation:
                member_data[m]["bonus_shares"] += delegation[m]
            if m in delegation_timestamp and delegation_timestamp[m] is not None and m in delegation:
                member_data[m].append_share_age(delegation_timestamp[m], delegation[m])
        
        print("update share age")
        
        empty_shares = []
        latest_enrollment = None
        for m in member_data:
            if member_data[m]["shares"] <= 0:
                empty_shares.append(m)
Example #2
0
                         sponsor = account
                         mngtData = {
                             "index": start_index,
                             "source": "mgmt",
                             "memo": "",
                             "account": account,
                             "sponsor": sponsor,
                             "sponsee": {},
                             "shares": mngt_shares,
                             "vests": float(0),
                             "timestamp": formatTimeString(timestamp),
                             "status": "Valid",
                             "share_type": "Mgmt"
                         }
                         start_index += 1
                         trxStorage.add(mngtData)
     print("total_mgnt_shares_sum: %d - shares %d" %
           (total_mgnt_shares_sum, shares_sum))
 # check delegation
 if False:
     delegation = {}
     sum_sp = {}
     sum_sp_shares = {}
     sum_sp_leased = {}
     account = "steembasicincome"
     excluded_accounts = ["blocktrades"]
     delegation = {}
     delegation_shares = {}
     sum_sp = 0
     sum_sp_leased = 0
     sum_sp_shares = 0