|
|
|
@ -7,6 +7,7 @@ from suchwow import config
|
|
|
|
|
from suchwow.models import Post, Profile, Comment, Notification, db
|
|
|
|
|
from suchwow.routes import auth, comment, post, profile
|
|
|
|
|
from suchwow.utils.decorators import login_required
|
|
|
|
|
from suchwow import wownero
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
@ -50,5 +51,16 @@ def init():
|
|
|
|
|
# init db
|
|
|
|
|
db.create_tables([Post, Profile, Comment, Notification])
|
|
|
|
|
|
|
|
|
|
@app.cli.command("payout_users")
|
|
|
|
|
def payout_users():
|
|
|
|
|
wallet = wownero.Wallet()
|
|
|
|
|
for post in Post.select():
|
|
|
|
|
submitter = Profile.get(username=post.submitter)
|
|
|
|
|
balances = wallet.balances(post.account_index)
|
|
|
|
|
if balances[1] > 0:
|
|
|
|
|
print(f"Post #{post.id} has {balances[1]} funds unlocked and ready to send. Sweeping all funds to user's address ({submitter.address}).")
|
|
|
|
|
sweep = wallet.sweep_all(account=post.account_index, dest_address=submitter.address)
|
|
|
|
|
print(sweep)
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
app.run()
|
|
|
|
|