import pywaves as pw
def main():
node = "https://nodes.wavesnodes.com"
chain = "mainnet"
pw.setNode(node=node, chain=chain)
private_key = #############
my_address_statement = pw.Address(privateKey=private_key)
WAVES_balance = my_address_statement.balance()
print("Your WAVES balance is: %d." % WAVES_balance)
main()
main()
Eventually this code produces the error indicated in the title. How can this be avoided?
As it turns out this segment of code is redundant:
node = "https://nodes.wavesnodes.com"
chain = "mainnet"
pw.setNode(node=node, chain=chain)
Refactoring without it resolved the issue.