Merge pull request #1214 from lzl124631x/ricl-get-block-by-number

return full tx
pull/1222/head
Leo Chen 5 years ago committed by GitHub
commit b62ad36297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      internal/hmyapi/blockchain.go

@ -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) {
block, err := s.b.BlockByNumber(ctx, blockNr)
if block != nil {
response, err := RPCMarshalBlock(block, false, false)
response, err := RPCMarshalBlock(block, true, fullTx)
if err == nil && blockNr == rpc.PendingBlockNumber {
// Pending blocks need to nil out a few fields
for _, field := range []string{"hash", "nonce", "miner"} {

Loading…
Cancel
Save