def listfiles_local(state, obj): files = [] if "payload" in obj and "blocks" in obj["payload"]: for block in obj["payload"]["blocks"]: for transaction in block["transactions"]: files.append({ "name": transaction["name"], "size": transaction["size"], "downloaded": transaction["downloaded"] }) state["files"]["local"] = files util.colorjson(files) return 0
def listfiles_remote(state, obj): files = [] if "payload" in obj and "roots" in obj["payload"]: for root in obj["payload"]["roots"]: for block in root["blocks"]: for transaction in block["transactions"]: files.append({ "owner": root["owner"], "name": transaction["name"], "size": transaction["size"], "downloaded": transaction["downloaded"] }) state["files"]["remote"] = files util.colorjson(files) return 0
def roguedump(state, obj): util.colorjson(obj) return 0
def bmining(state, obj): util.colorjson(obj) return 0
def peeroffline(state, obj): util.colorjson(obj) return 0
def badvertise(state, obj): util.colorjson(obj) return 0
def tshare(state, obj): util.colorjson(obj) return 0
def jobfinalize(state, obj): util.colorjson(obj) return 0
def jobdone(state, obj): util.colorjson(obj) return 0
def jobadd(state, obj): util.colorjson(obj) return 0
def message(state, obj): state["messages"].append(obj) util.colorjson(obj) return 0
def listpeers(state, obj): state["peers"] = obj util.colorjson(obj) return 0
def versiondump(state, obj): util.colorjson(obj) return 0