fix getblock & tx for genesis
This commit is contained in:
parent
7c4e8c5750
commit
beb8244570
@ -61,6 +61,21 @@ func (b *MonetaryUnitRPC) Initialize() error {
|
|||||||
// Get Block
|
// Get Block
|
||||||
func (b *MonetaryUnitRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) {
|
func (b *MonetaryUnitRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) {
|
||||||
|
|
||||||
|
if height == 0 {
|
||||||
|
var err error
|
||||||
|
if hash == "" {
|
||||||
|
hash, err = b.GetBlockHash(height)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !b.ParseBlocks {
|
||||||
|
return b.GetBlockFull(hash)
|
||||||
|
}
|
||||||
|
return b.GetBlockWithoutHeader(hash, height)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
if hash == "" && height > 0 {
|
if hash == "" && height > 0 {
|
||||||
hash, err = b.GetBlockHash(height)
|
hash, err = b.GetBlockHash(height)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user