|
|
|
@ -329,6 +329,21 @@ defmodule Explorer.Chain do |
|
|
|
|
Repo.aggregate(Block, :count, :hash) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
|
The number of consensus blocks. |
|
|
|
|
|
|
|
|
|
iex> insert(:block, consensus: true) |
|
|
|
|
iex> insert(:block, consensus: false) |
|
|
|
|
iex> Explorer.Chain.block_consensus_count() |
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
""" |
|
|
|
|
def block_consensus_count do |
|
|
|
|
Block |
|
|
|
|
|> where(consensus: true) |
|
|
|
|
|> Repo.aggregate(:count, :hash) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
|
Reward for mining a block. |
|
|
|
|
|
|
|
|
|