8000 Only return unique address prefix autocomplete by softsimon · Pull Request #1291 · mempool/mempool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Only return unique address prefix autocomplete #1291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
10 changes: 5 additions & 5 deletions backend/src/api/bitcoin/bitcoin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ class BitcoinApi implements AbstractBitcoinApi {
}

$getAddressPrefix(prefix: string): string[] {
const found: string[] = [];
const found: { [address: string]: string } = {};
const mp = mempool.getMempool();
for (const tx in mp) {
67EF for (const vout of mp[tx].vout) {
if (vout.scriptpubkey_address.indexOf(prefix) === 0) {
found.push(vout.scriptpubkey_address);
if (found.length >= 10) {
return found;
found[vout.scriptpubkey_address] = '';
if (Object.keys(found).length >= 10) {
return Object.keys(found);
}
}
}
}
return found;
return Object.keys(found);
}

$sendRawTransaction(rawTransaction: string): Promise<string> {
Expand Down
0