diff --git a/services/account_service.go b/services/account_service.go index 37cc080..8c8adff 100644 --- a/services/account_service.go +++ b/services/account_service.go @@ -115,16 +115,17 @@ func (s *AccountAPIService) AccountCoins( BlockIdentifier: block, Coins: coins, } - //@Todo include_mempool query + + //@Todo include_mempool query unsupported + //https://github.com/coinbase/rosetta-bitcoin/issues/36#issuecomment-724992022 + //Once mempoolcoins are supported also change the bool service/types.go:MempoolCoins to true if len(request.Currencies) > 0 { filtered := []*types.Coin{} + for _, curr := range request.Currencies { - if curr == nil { - continue - } for _, coin := range coins { - if coin.Amount.Currency.Symbol == curr.Symbol { + if types.Hash(curr) == types.Hash(coin.Amount.Currency) { filtered = append(filtered, coin) } } diff --git a/services/network_service.go b/services/network_service.go index edeb721..04dcb02 100644 --- a/services/network_service.go +++ b/services/network_service.go @@ -99,6 +99,7 @@ func (s *NetworkAPIService) NetworkOptions( OperationTypes: bitcoin.OperationTypes, Errors: Errors, HistoricalBalanceLookup: HistoricalBalanceLookup, + MempoolCoins: MempoolCoins, }, }, nil } diff --git a/services/types.go b/services/types.go index cf64ed2..21edf0e 100644 --- a/services/types.go +++ b/services/types.go @@ -31,6 +31,9 @@ const ( // that historical balance lookup is supported. HistoricalBalanceLookup = true + //Include mempool coins when fetching account coints + MempoolCoins = false + // inlineFetchLimit is the maximum number // of transactions to fetch inline. inlineFetchLimit = 100