Created
November 3, 2022 23:20
-
-
Save plowsof/bf2bf82d40a275cf0b6bb22a0a5da8ba to your computer and use it in GitHub Desktop.
get number of outputs the wrong way
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 requests | |
import json | |
import pprint | |
from monerorpc.authproxy import AuthServiceProxy, JSONRPCException | |
import time | |
rpc_url = "http://127.0.0.1:18082/json_rpc" | |
rpc_connection = AuthServiceProxy(service_url=rpc_url) | |
offset = 100 | |
start = 0 | |
stop = offset | |
exit_loop = 0 | |
while True: | |
try: | |
resp = rpc_connection.export_outputs({"all":True,"start":start,"stop":stop}) | |
pprint.pprint(resp) | |
start += offset | |
stop += offset | |
except Exception as e: | |
print(start) | |
print(stop) | |
print("oops we found the end") | |
time.sleep(5) | |
start -= offset | |
offset = 1 | |
stop = start + offset | |
while True: | |
try: | |
resp = rpc_connection.export_outputs({"all":True,"start":start,"stop":stop}) | |
pprint.pprint(resp) | |
start += offset | |
stop += offset | |
pass | |
except Exception as e: | |
print(start) | |
print(stop) | |
print(f"we have {start} number of outputs") | |
exit_loop = 1 | |
break | |
if exit_loop == 1: | |
break | |
params = { | |
"in": True, | |
"account_index": 0, | |
} | |
info = rpc_connection.get_transfers(params) | |
print(len(info['in'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
4100
4200
oops we found the end
Error: '{'error': {'code': -1, 'message': 'vector::reserve'}, 'id': 86, 'jsonrpc': '2.0'}'
4043
4044
we have 4043 number of outputs
num of get_transfers: 4025