Browse Source

- playing with OP_RETURN formatting

- WIP display of output types
fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
bcc340bf85
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 6
      public/css/styling.css
  2. 19
      views/includes/transaction-io-details.pug

6
public/css/styling.css

@ -61,6 +61,12 @@ pre {
margin-right: 4px;
}
.tx-out-type-tag {
background-color: #e1e1e1;
color: black;
font-weight: 300;
}
#subheader a {
margin-right: 20px;
}

19
views/includes/transaction-io-details.pug

@ -85,6 +85,14 @@ div(class="row monospace")
div(class="tx-io-desc")
if (vout.scriptPubKey)
if (vout.scriptPubKey.addresses)
if (false)
if (vout.scriptPubKey.type == "pubkeyhash")
span(class="tag tx-out-type-tag") P2PKH
else if (vout.scriptPubKey.type == "scripthash")
span(class="tag tx-out-type-tag") P2SH
else if (vout.scriptPubKey.type == "witness_v0_keyhash")
span(class="tag tx-out-type-tag") V0_P2WPKH
a(id=("output-" + voutIndex), href=("/address/" + vout.scriptPubKey.addresses[0]))
span(class="monospace word-wrap") #{vout.scriptPubKey.addresses[0]}
@ -99,14 +107,19 @@ div(class="row monospace")
a(data-toggle="tooltip", title=("Development donation address. All support is appreciated!"))
i(class="fas fa-certificate text-primary")
else if (vout.scriptPubKey.hex && vout.scriptPubKey.hex.startsWith('6a24aa21a9ed'))
span(class="monospace") Segregated Witness committment
span(class="monospace")
span(class="font-weight-bold") OP_RETURN
span(title="Segregated Witness", data-toggle="tooltip") SegWit
span committment
a(href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure", data-toggle="tooltip", title="View developer docs", target="_blank")
i(class="fas fa-info-circle")
else if (vout.scriptPubKey.asm && vout.scriptPubKey.asm.startsWith('OP_RETURN '))
span(class="monospace") OP_RETURN:
span(class="monospace text-muted") #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))}
span(class="monospace")
span(class="font-weight-bold") OP_RETURN:
span(class="text-muted") #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))}
else
span(class="monospace")

Loading…
Cancel
Save