Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slpdb validation: UnboundLocalError: local variable 'tx_data' referenced before assignment (flexUSD) #244

Open
molecular opened this issue Nov 10, 2022 · 0 comments

Comments

@molecular
Copy link

molecular commented Nov 10, 2022

On master branch, after "rebuild history", all the flexUSD transactions have red exclamation mark. If I click "revalidate" on one of the tx, I get:

|1361.239| |15| [SLPDBValidationJob] local variable 'tx_data' referenced before assignment: Traceback (most recent call last):
  File "/home/nick/bitcoin/electron-cash-slp/electroncash/slp_slpdb_validator.py", line 66, in validate
    result = self._query_server(server)
  File "/home/nick/bitcoin/electron-cash-slp/electroncash/slp_slpdb_validator.py", line 59, in _query_server
    return tx_data
UnboundLocalError: local variable 'tx_data' referenced before assignment

Using this to get more info...

diff --git a/electroncash/slp_slpdb_validator.py b/electroncash/slp_slpdb_validator.py
index 66b7856e9..3b5f01ef0 100644
--- a/electroncash/slp_slpdb_validator.py
+++ b/electroncash/slp_slpdb_validator.py
@@ -54,8 +54,10 @@ class SLPDBValidationJob(PrintError):
 
         if result_json["c"]:  # confirmed tx
             tx_data = result_json["c"]
-        if result_json["u"]:  # unconfirmed tx
+        elif result_json["u"]:  # unconfirmed tx
             tx_data = result_json["u"]
+        else:
+            print("can't parse json: ", result_json)
         return tx_data

reveals empty server response:

can't parse json:  {'c': [], 'u': []}

Has slpdb.electron-cash.de mapped out flexUSD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant