(hash common.Uint256, getTxBytes bool)
| 104 | } |
| 105 | |
| 106 | func getBlock(hash common.Uint256, getTxBytes bool) (interface{}, int64) { |
| 107 | block, err := bactor.GetBlockFromStore(hash) |
| 108 | if err != nil { |
| 109 | return nil, berr.UNKNOWN_BLOCK |
| 110 | } |
| 111 | if block == nil { |
| 112 | return nil, berr.UNKNOWN_BLOCK |
| 113 | } |
| 114 | if block.Header == nil { |
| 115 | return nil, berr.UNKNOWN_BLOCK |
| 116 | } |
| 117 | if getTxBytes { |
| 118 | return common.ToHexString(block.ToArray()), berr.SUCCESS |
| 119 | } |
| 120 | return bcomn.GetBlockInfo(block), berr.SUCCESS |
| 121 | } |
| 122 | |
| 123 | //get block by hash |
| 124 | func GetBlockByHash(cmd map[string]interface{}) map[string]interface{} { |
no test coverage detected