pull/541/head
sidhujag 2020-09-02 18:51:54 -07:00
parent c3798e177b
commit a18e8c7901
5 changed files with 7 additions and 7 deletions

View File

@ -260,7 +260,7 @@ type Utxo struct {
Coinbase bool `json:"coinbase,omitempty"`
AssetInfo *bchain.AssetInfo `json:"assetInfo,omitempty"`
Script string `json:"script,omitempty"`
AssetDetails *AssetSpecific `json:"assets,omitempty"`
Assets []*AssetSpecific `json:"assets,omitempty"`
}
// Utxos is array of Utxo

View File

@ -1701,11 +1701,11 @@ func (w *Worker) getAddrDescUtxo(addrDesc bchain.AddressDescriptor, ba *bchain.A
}
// GetAddressUtxo returns unspent outputs for given address
func (w *Worker) GetAddressUtxo(address string, onlyConfirmed bool) (Utxos, []AssetSpecific, error) {
func (w *Worker) GetAddressUtxo(address string, onlyConfirmed bool) (Utxos, []*AssetSpecific, error) {
if w.chainType != bchain.ChainBitcoinType {
return nil, nil, NewAPIError("Not supported", true)
}
assets := make([]AssetSpecific, 0, 0)
assets := make([]*AssetSpecific, 0, 0)
assetsMap := make(map[uint32]bool, 0)
start := time.Now()
addrDesc, err := w.chainParser.GetAddrDescFromAddress(address)

View File

@ -651,7 +651,7 @@ func (w *Worker) GetXpubAddress(xpub string, page int, txsOnPage int, option Acc
}
// GetXpubUtxo returns unspent outputs for given xpub
func (w *Worker) GetXpubUtxo(xpub string, onlyConfirmed bool, gap int) (Utxos, []AssetSpecific, error) {
func (w *Worker) GetXpubUtxo(xpub string, onlyConfirmed bool, gap int) (Utxos, []*AssetSpecific, error) {
start := time.Now()
data, _, err := w.getXpubData(xpub, 0, 1, AccountDetailsBasic, &AddressFilter{
Vout: AddressFilterVoutOff,
@ -662,7 +662,7 @@ func (w *Worker) GetXpubUtxo(xpub string, onlyConfirmed bool, gap int) (Utxos, [
return nil, nil, err
}
r := make(Utxos, 0, 8)
assets := make([]AssetSpecific, 0, 0)
assets := make([]*AssetSpecific, 0, 0)
assetsMap := make(map[uint32]bool, 0)
for ci, da := range [][]xpubAddress{data.addresses, data.changeAddresses} {
for i := range da {

View File

@ -1240,7 +1240,7 @@ func (s *PublicServer) apiUtxo(r *http.Request, apiVersion int) (interface{}, er
}
}
if(len(assets) > 0) {
utxo.assets = assets
utxo.Assets = assets
}
return utxo, err
}

View File

@ -506,7 +506,7 @@ func (s *WebsocketServer) getAccountUtxo(descriptor string) (interface{}, error)
}
}
if(len(assets) > 0) {
utxo.assets = assets
utxo.Assets = assets
}
return utxo, nil
}