Skip to content
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

Add Angor mainnet key #212

Merged
merged 2 commits into from
May 24, 2024
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
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Blockcore.Indexer.Angor/Sync/SyncTasks/ProjectsSyncRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ProjectsSyncRunner : TaskRunner
readonly SyncConnection syncConnection;

public static string AngorTestKey = "tpubD8JfN1evVWPoJmLgVg6Usq2HEW9tLqm6CyECAADnH5tyQosrL6NuhpL9X1cQCbSmndVrgLSGGdbRqLfUbE6cRqUbrHtDJgSyQEY2Uu7WwTL";
public static string AngorMainKey = "xpub661MyMwAqRbcGNxKe9aFkPisf3h32gHLJm8f9XAqx8FB1Nk6KngCY8hkhGqxFr2Gyb6yfUaQVbodxLoC1f3K5HU9LM1CXE59gkEXSGCCZ1B";

ExtPubKey extendedPublicKey;

Expand All @@ -39,7 +40,15 @@ public ProjectsSyncRunner(IOptions<IndexerSettings> configuration, ILogger<Proje

Delay = TimeSpan.FromMinutes(1);

extendedPublicKey = new BitcoinExtPubKey(AngorTestKey, new BitcoinSignet()).ExtPubKey;
// use the rpc port but this is not a reliable way to determine mainnet
if (syncConnection.RpcAccessPort == 8333) // mainnet
{
extendedPublicKey = new BitcoinExtPubKey(AngorMainKey, new BitcoinMain()).ExtPubKey;
}
else
{
extendedPublicKey = new BitcoinExtPubKey(AngorTestKey, new BitcoinSignet()).ExtPubKey;
}
}

private bool CanRunProjectSync()
Expand Down
Loading