|
|
@ -24,7 +24,7 @@ func NewPublicBlockChainAPI(b Backend) *PublicBlockChainAPI { |
|
|
|
func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, blockNr rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) { |
|
|
|
func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, blockNr rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) { |
|
|
|
block, err := s.b.BlockByNumber(ctx, blockNr) |
|
|
|
block, err := s.b.BlockByNumber(ctx, blockNr) |
|
|
|
if block != nil { |
|
|
|
if block != nil { |
|
|
|
response, err := RPCMarshalBlock(block, false, false) |
|
|
|
response, err := RPCMarshalBlock(block, true, fullTx) |
|
|
|
if err == nil && blockNr == rpc.PendingBlockNumber { |
|
|
|
if err == nil && blockNr == rpc.PendingBlockNumber { |
|
|
|
// Pending blocks need to nil out a few fields
|
|
|
|
// Pending blocks need to nil out a few fields
|
|
|
|
for _, field := range []string{"hash", "nonce", "miner"} { |
|
|
|
for _, field := range []string{"hash", "nonce", "miner"} { |
|
|
|