Skip to content

Commit

Permalink
Merge pull request #116 from skynetcap/feature/optimize-1
Browse files Browse the repository at this point in the history
Remove "null" token entries when Token isn't cached.
  • Loading branch information
skynetcap authored Aug 14, 2022
2 parents 5934a7b + 6de2a1c commit acaf775
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ public String getMarketListingName(MarketListing market) {

private List<Token> buildActiveTokens() {
return getMarketListings().stream()
.filter(marketListing -> marketListing.getBaseMint() != null)
.map(listing -> Token.builder()
.publicKey(listing.getBaseMint())
.name(tokenManager.getTokenNameByMint(listing.getBaseMint()))
.symbol(tokenManager.getTokenSymbolByMint(listing.getBaseMint()))
.address(listing.getBaseMint() == null ? null : listing.getBaseMint().toBase58())
.address(listing.getBaseMint().toBase58())
.build())
.distinct()
.toList();
Expand Down

0 comments on commit acaf775

Please sign in to comment.