mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Added ommerCount to Block
This commit is contained in:
parent
76e45cf2c1
commit
460d1586e6
1 changed files with 9 additions and 0 deletions
|
|
@ -608,6 +608,14 @@ func (b *Block) OmmerHash(ctx context.Context) (Bytes32, error) {
|
||||||
return Bytes32{block.UncleHash()}, nil
|
return Bytes32{block.UncleHash()}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Block) OmmerCount(ctx context.Context) (int32, error) {
|
||||||
|
block, err := b.resolve(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
return int32(len(block.Uncles())), nil
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Block) Ommers(ctx context.Context) ([]*Block, error) {
|
func (b *Block) Ommers(ctx context.Context) ([]*Block, error) {
|
||||||
block, err := b.resolve(ctx)
|
block, err := b.resolve(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -890,6 +898,7 @@ func NewHandler(n *node.Node) (http.Handler, error) {
|
||||||
mixHash: Bytes32!
|
mixHash: Bytes32!
|
||||||
difficulty: BigNum!
|
difficulty: BigNum!
|
||||||
totalDifficulty: BigNum!
|
totalDifficulty: BigNum!
|
||||||
|
ommerCount: Int!
|
||||||
ommers: [Block]!
|
ommers: [Block]!
|
||||||
ommerHash: Bytes32!
|
ommerHash: Bytes32!
|
||||||
transactions: [Transaction!]!
|
transactions: [Transaction!]!
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue