Override desc from address function
parent
abeb79fd8f
commit
fc79ddab39
|
@ -66,6 +66,11 @@ func GetChainParams(chain string) *chaincfg.Params {
|
|||
}
|
||||
}
|
||||
|
||||
func (p *GhostParser) GetAddrDescFromAddress(address string) (bchain.AddressDescriptor, error) {
|
||||
addressByte := []byte(address)
|
||||
return bchain.AddressDescriptor(addressByte), nil
|
||||
}
|
||||
|
||||
func (p *GhostParser) GetAddrDescFromVout(output *bchain.Vout) (bchain.AddressDescriptor, error) {
|
||||
addrs := output.ScriptPubKey.Addresses
|
||||
if addrs == nil || len(addrs) == 0 {
|
||||
|
|
|
@ -58,6 +58,13 @@ func (b *GhostRPC) Initialize() error {
|
|||
|
||||
// GetBlock returns block with given hash.
|
||||
func (g *GhostRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) {
|
||||
var err error
|
||||
if hash == "" && height > 0 {
|
||||
hash, err = g.GetBlockHash(height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
block, err := g.GetBlockFull(hash)
|
||||
return block, err
|
||||
}
|
Loading…
Reference in New Issue