mirror of
https://github.com/janoside/btc-rpc-explorer.git
synced 2026-08-13 12:33:13 +02:00
-new fun item showing example of future-dated timelock (coinbase) tx -special-case code for mainnet genesis coinbase tx, to avoid indicating that satoshi spent these unspendable coins -tx details: skip displaying locktime when it's meaningless (the raw data is in the json if anyone wants it); show additional info about locktime meaning -tx details: show byte-size in addition to vByte size, if applicable -fix for recently broken donut chart on /mining-summary -changelog
81 lines
2.9 KiB
Text
81 lines
2.9 KiB
Text
extends layout
|
|
|
|
block headContent
|
|
title Mining Template
|
|
|
|
block content
|
|
+pageTitle("Mining Template")
|
|
|
|
+dismissableInfoAlert("miningTemplatePageNoteDismissed", "About Mining Template...")
|
|
.mb-2 The Mining Template tool displays the output from the <b>getblocktemplate</b> command which is often used by miners for building a candidate for the "next block". The transactions shown here were selected from your node's mempool and generally represent those with the highest (effective) fees.
|
|
div These details are just a best-guess based on the current mempool and will change with each refresh.
|
|
|
|
+pageTabs(["Details", "JSON"])
|
|
|
|
.tab-content
|
|
+pageTab("Details", true)
|
|
+contentSection("Summary")
|
|
+summaryRow(3)
|
|
+summaryItem("Transactions")
|
|
| #{blockTemplate.transactions.length.toLocaleString()}
|
|
|
|
+summaryItem("Fee Rates", null, "sat/vB")
|
|
| #{new Decimal(minFeeRate).toDP(2)} - #{new Decimal(maxFeeRate).toDP(2)}
|
|
|
|
+summaryItem("Total Fees")
|
|
- var subsidy = coinConfig.blockRewardFunction(blockTemplate.height, global.activeBlockchain);
|
|
- var totalFees = new Decimal(blockTemplate.coinbasevalue).dividedBy(coinConfig.baseCurrencyUnit.multiplier).minus(subsidy);
|
|
|
|
+valueDisplay(totalFees)
|
|
|
|
if (true)
|
|
+contentSection(blockTemplate.transactions.length.toLocaleString() + " Transaction" + (blockTemplate.transactions.length == 1 ? "" : "s"))
|
|
.table-responsive
|
|
table.table.table-borderless.table-striped.mb-0
|
|
thead
|
|
tr
|
|
th.text-card-highlight.text-uppercase.fw-light #
|
|
th.text-card-highlight.text-uppercase.fw-light ID
|
|
th.text-end.text-card-highlight.fw-light
|
|
span.text-uppercase Fee Rate
|
|
small.ms-1 (sat/vB)
|
|
|
|
th.text-end.text-card-highlight.text-uppercase.fw-light Fee
|
|
th.text-end.text-card-highlight.fw-light
|
|
span.text-uppercase Weight
|
|
small.ms-1 (wu)
|
|
//th Depends
|
|
|
|
tbody
|
|
each tx, txIndex in blockTemplate.transactions
|
|
tr
|
|
td
|
|
small.text-muted #{(txIndex).toLocaleString()}
|
|
|
|
td
|
|
a(href=`./tx/${tx.txid}`) #{utils.ellipsizeMiddle(tx.txid, 16)}
|
|
|
|
td.text-end
|
|
| #{new Decimal(tx.fee).dividedBy(tx.weight).times(4).toDP(2)}
|
|
|
|
if (tx.avgFeeRate)
|
|
span.text-muted.ms-2 (
|
|
span.border-dotted(title="Effective fee rate, including ancestor transactions", data-bs-toggle="tooltip")
|
|
span.text-muted #{new Decimal(tx.avgFeeRate).toDP(2)}
|
|
| )
|
|
|
|
|
|
td.text-end
|
|
+valueDisplay(new Decimal(tx.fee).dividedBy(coinConfig.baseCurrencyUnit.multiplier))
|
|
|
|
td.text-end #{tx.weight.toLocaleString()}
|
|
//td #{tx.depends.map(x => `#${(x - 1)}`).join(", ")}
|
|
|
|
|
|
+pageTab("JSON")
|
|
- var x = blockTemplate;
|
|
- delete x.transactions;
|
|
|
|
+contentSection("Template Details")
|
|
pre
|
|
code.json #{JSON.stringify(x, null, 4)}
|