Skip to content

Instantly share code, notes, and snippets.

@simform-solutions
Created September 20, 2017 07:00
Show Gist options
  • Save simform-solutions/715bf28d3aed101f4c8a5843e880f71e to your computer and use it in GitHub Desktop.
Save simform-solutions/715bf28d3aed101f4c8a5843e880f71e to your computer and use it in GitHub Desktop.
# Gets the first address after the last address with balance. If there is no saved address it will generate a new one
def get_deposit_address():
try:
l_index = fal_balance[0]["l_index"]
if l_index == 0:
deposit_address = address_data[0]["address"]
return deposit_address
for p in address_data:
address = p["address"]
checksum = p["checksum"]
integrity = verify_checksum(checksum, address)
if p["index"] > l_index and integrity:
deposit_address = p["address"]
return deposit_address
elif not integrity:
return "Invalid checksum!!!"
print("Generating address...")
generate_addresses(1)
for p in address_data:
address = p["address"]
checksum = p["checksum"]
integrity = verify_checksum(checksum, address)
if p["index"] > l_index and integrity:
deposit_address = p["address"]
return deposit_address
except:
"An error acoured while trying to get the deposit address"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment