MultiChain / multichain-explorer

Web-based explorer for MultiChain blockchains
GNU Affero General Public License v3.0
177 stars 140 forks source link

Server error on Metadata transaction #8

Closed reiven closed 8 years ago

reiven commented 8 years ago

Hi, i'm trying to access the details of a transacion marked as "metadata" by the explorer, and i got "A server error occurred. Please contact the administrator." All the other transactions looks ok

Traceback says:

Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
...
...
/multichain-explorer/Mce/abe.py", line 1167, in row_to_html
    if row['address_version'] is chain.script_addr_vers:
KeyError: 'address_version'

Multichain version Version 1.0 alpha 20 Blockexplorer is in sync with latests master branch

Let me know if you need any further information

ml-bw commented 8 years ago

Same issue with Version 1.0 alpha 21 and latest multichain-explorer.

bitcartel commented 8 years ago

Please add this to Mce/DataStore.py at line 1614:

txout['address_version'] = None

So the start of the function should look like this:

    def _export_scriptPubKey(store, txout, chain, scriptPubKey):
        """In txout, set script_type, address_version, binaddr, and for multisig, required_signatures."""

        if scriptPubKey is None:
            txout['script_type'] = None
            txout['binaddr'] = None
            txout['address_version'] = None
            return

Restart the explorer. Does this fix the issue?

If not, insert a debug statement at line 1167 of Mce/abe.py, and send me the output of the tx causing the exception.

    print ">>> tx = ", row
    if row['address_version'] is chain.script_addr_vers:

Thanks.

ml-bw commented 8 years ago

It fixes the issue. Thanks a lot for figuring this out.