File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1925,7 +1925,8 @@ func NewTransactionAPI(b Backend, nonceLock *AddrLocker) *TransactionAPI {
1925
1925
// GetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.
1926
1926
func (api * TransactionAPI ) GetBlockTransactionCountByNumber (ctx context.Context , blockNr rpc.BlockNumber ) * hexutil.Uint {
1927
1927
if block , _ := api .b .BlockByNumber (ctx , blockNr ); block != nil {
1928
- n := hexutil .Uint (len (block .Transactions ()))
1928
+ txs , _ := api .getAllBlockTransactions (ctx , block )
1929
+ n := hexutil .Uint (len (txs ))
1929
1930
return & n
1930
1931
}
1931
1932
@@ -1935,7 +1936,8 @@ func (api *TransactionAPI) GetBlockTransactionCountByNumber(ctx context.Context,
1935
1936
// GetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.
1936
1937
func (api * TransactionAPI ) GetBlockTransactionCountByHash (ctx context.Context , blockHash common.Hash ) * hexutil.Uint {
1937
1938
if block , _ := api .b .BlockByHash (ctx , blockHash ); block != nil {
1938
- n := hexutil .Uint (len (block .Transactions ()))
1939
+ txs , _ := api .getAllBlockTransactions (ctx , block )
1940
+ n := hexutil .Uint (len (txs ))
1939
1941
return & n
1940
1942
}
1941
1943
You can’t perform that action at this time.
0 commit comments