You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.9KB

  1. extends layout
  2. block headContent
  3. title Mempool Info
  4. block content
  5. h1 Mempool Info
  6. hr
  7. if (getmempoolinfo)
  8. p Data from RPC command
  9. a(href="https://bitcoin.org/en/developer-reference#getmempoolinfo") getmempoolinfo
  10. table(class="table")
  11. tr
  12. th(class="table-active properties-header") Transaction Count
  13. td #{getmempoolinfo.size.toLocaleString()}
  14. tr
  15. - var scales = [ {val:1000000000, name:"GB"}, {val:1000000, name:"MB"}, {val:1000, name:"kB"} ];
  16. - var scaleDone = false;
  17. th(class="table-active properties-header") Tx Size
  18. td(class="monospace")
  19. span #{getmempoolinfo.bytes.toLocaleString()} bytes
  20. each item in scales
  21. if (!scaleDone)
  22. - var fraction = Math.floor(getmempoolinfo.bytes / item.val);
  23. if (fraction >= 1)
  24. - scaleDone = true;
  25. span(class="text-muted") (#{fraction} #{item.name})
  26. tr
  27. - var scales = [ {val:1000000000, name:"GB"}, {val:1000000, name:"MB"}, {val:1000, name:"kB"} ];
  28. - var scaleDone = false;
  29. th(class="table-active properties-header") Total Size
  30. td(class="monospace")
  31. span #{getmempoolinfo.usage.toLocaleString()} bytes
  32. each item in scales
  33. if (!scaleDone)
  34. - var fraction = Math.floor(getmempoolinfo.usage / item.val);
  35. if (fraction >= 1)
  36. - scaleDone = true;
  37. span(class="text-muted") (#{fraction} #{item.name})
  38. tr
  39. th(class="table-active properties-header") Max Size
  40. td(class="monospace") #{getmempoolinfo.maxmempool.toLocaleString()}
  41. tr
  42. th(class="table-active properties-header") Min Fee
  43. td(class="monospace") #{getmempoolinfo.mempoolminfee.toLocaleString()}
  44. tr
  45. th(class="table-active properties-header") Total Fees
  46. td(class="monospace") #{mempoolstats.totalFee.toLocaleString()}
  47. h4 Transaction count by fee level
  48. hr
  49. if (false)
  50. #{JSON.stringify(mempoolstats)}
  51. - var feeBucketLabels = [ "0 - 5 sat/B", "6 - 10 sat/B", "11 - 25 sat/B", "26 - 50 sat/B", "51 - 75 sat/B", "76 - 100 sat/B", "101 - 150 sat/B", "151+ sat/B" ];
  52. - var feeBucketTxCounts = [ mempoolstats.fee_0_5, mempoolstats.fee_6_10, mempoolstats.fee_11_25, mempoolstats.fee_26_50, mempoolstats.fee_51_75, mempoolstats.fee_76_100, mempoolstats.fee_101_150, mempoolstats.fee_151_max ];
  53. - var bgColors = [ "bg-primary", "bg-success", "bg-info", "bg-warning", "bg-danger", "bg-primary progress-bar-striped", "bg-success progress-bar-striped", "bg-info progress-bar-striped" ];
  54. table(class="table")
  55. each feeBucketLabel, index in feeBucketLabels
  56. tr
  57. th(class=("properties-header " + bgColors[index])) #{feeBucketLabel}
  58. td(class="monospace") #{feeBucketTxCounts[index].toLocaleString()}
  59. div(class="progress")
  60. each txCount, index in feeBucketTxCounts
  61. - var percent = 100 * txCount / getmempoolinfo.size;
  62. div(class=("progress-bar " + bgColors[index]), role="progressbar", style=("width: " + percent + "%;"), aria-valuenow=percent, aria-valuemin="0", aria-valuemax="100")
  63. span #{txCount}