compile
parent
c3798e177b
commit
a18e8c7901
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue