Skip to content

Commit

Permalink
Add Angor mainnet key (#212)
Browse files Browse the repository at this point in the history
* Add mainnet key

* update mainnet key
  • Loading branch information
dangershony authored May 24, 2024
1 parent c2ed435 commit 0208cc6
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 0208cc6

Please sign in to comment.