diff --git a/Mce/abe.py b/Mce/abe.py index 6ebb20a..7fbf4f6 100755 --- a/Mce/abe.py +++ b/Mce/abe.py @@ -1399,18 +1399,18 @@ def row_to_html(row, this_ch, other_ch, no_link_text): body += [ '', txid[:10], '...:', row['vout'], ''] - + body += [''] # Decode earlier as we need to use script type novalidaddress=False - + the_script = None if this_ch is 'i': the_script = row['scriptSig']['hex'] else: the_script = row['scriptPubKey']['hex'] - + binscript = None if the_script is not None: @@ -1421,14 +1421,14 @@ def row_to_html(row, this_ch, other_ch, no_link_text): addressLabel = 'None' value = 0 - + if novalidaddress is False: if this_ch is 'i': try: resp = util.jsonrpc(chain_name, chain_url, "getrawtransaction", txid, 1) n = int(row['vout']) addressLabel = resp['vout'][n]['scriptPubKey']['addresses'][0] - value = resp['vout'][n]['value'] + value = resp['vout'][n]['value'] except Exception as e: pass else: @@ -1444,12 +1444,12 @@ def row_to_html(row, this_ch, other_ch, no_link_text): if version is chain.script_addr_vers: p2sh_flag = True addressLabel = '' + addressLabel + '' - + body += [ '\n', '', format_satoshis(value, chain), '\n', '', addressLabel] - + if p2sh_flag is True: body += ['
P2SH
'] body += [ '\n'] @@ -1604,7 +1604,7 @@ def row_to_html(row, this_ch, other_ch, no_link_text): body += [''] body += html_keyvalue_tablerow('Hash', tx['txid']) chain = page['chain'] - + chain_name = abe.store.get_multichain_name_by_id(chain.id) chain_url = abe.store.get_url_by_chain(chain) @@ -1636,7 +1636,7 @@ def row_to_html(row, this_ch, other_ch, no_link_text): '

Outputs

\n
\n', '', '\n'] - + pos = 0 for txout in tx['vout']: txout['pos'] = pos @@ -1697,6 +1697,27 @@ def handle_address(abe, page): body += [''] return + body += ['

Native Balance

'] + try: + resp = util.jsonrpc(multichain_name, url, "getaddressbalances", address) + if len(resp) is 0: + body += ['None'] + else: + body += [''] + except util.JsonrpcException as e: + msg= "Failed to get balancefor address: JSON-RPC error({0}): {1}".format(e.code, e.message) + body += ['
', msg ,'
'] + return + except IOError as e: + msg= "Failed to get balance for address: I/O error({0}): {1}".format(e.errno, e.strerror) + body += [''] + return + + body += ['

Asset Balances

'] try: row = abe.store.selectrow("""select pubkey_id from pubkey where pubkey_hash = ?""", @@ -2285,7 +2306,7 @@ def handle_mempooltx(abe, page): return s return abe.show_mempool_tx_json(page, resp) - + # MULTICHAIN END def do_rawtx(abe, page, chain):
IndexRedeemed at inputNativeTo addressScriptPubKey