Skip to content

Commit

Permalink
Require only one history peer in testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Dec 1, 2024
1 parent 0b2a1b0 commit 5c35ed7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/NetworkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export class NetworkClient {

public async requestTransactionReceipts(address: string, limit?: number) {
const client = await this.client;
return client.getTransactionReceiptsByAddress(address, limit);
// Require only one history peer when not in mainnet
const minPeers = Config.network === NETWORK_MAIN ? undefined : 1;
return client.getTransactionReceiptsByAddress(address, limit, /* startAt */ undefined, minPeers);
}

public async getTransactionsByAddress(
Expand All @@ -38,13 +40,15 @@ export class NetworkClient {
// minPeers?: number,
) {
const client = await this.client;
// Require only one history peer when not in mainnet
const minPeers = Config.network === NETWORK_MAIN ? undefined : 1;
return client.getTransactionsByAddress(
address,
undefined /* sinceBlockHeight */,
knownTransactionDetails,
undefined /* startAt */,
limit,
undefined /* minPeers */,
minPeers,
);
}

Expand Down

0 comments on commit 5c35ed7

Please sign in to comment.