Skip to content
Open
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
10 changes: 5 additions & 5 deletions Sources/BitcoinBlockchainSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class Program
{
private static int Main(string[] args)
{
if (args.Length != 1)
if (args.Length < 1)
{
Console.Error.WriteLine("Invalid command line. Run \"BitcoinBlockchainSample /?\" for usage.");
}
Expand All @@ -26,14 +26,14 @@ private static int Main(string[] args)
}
else
{
ParseBlockchainFiles(args[0]);
ParseBlockchainFiles(args[0], args.Length > 1 ? args[1] : null);
}
}

return 0;
}

private static void ParseBlockchainFiles(string pathToBlockchain)
private static void ParseBlockchainFiles(string pathToBlockchain, string firstBlock)
{
BlockchainStatistics overallStatistics = new BlockchainStatistics();
BlockchainStatistics blockFileStatistics = new BlockchainStatistics();
Expand All @@ -44,7 +44,7 @@ private static void ParseBlockchainFiles(string pathToBlockchain)
// to its constructor.
// TIP: Class IBlockchainParser provides several constructors that are useful
// in different scenarios.
IBlockchainParser blockchainParser = new BlockchainParser(pathToBlockchain);
IBlockchainParser blockchainParser = new BlockchainParser(pathToBlockchain, firstBlock);

// Call blockchainParser.SetBlockId is the blockchain uses a value different than the standard one
// for the "BlockId" field of each block. For example on testnet / testnet3.
Expand Down Expand Up @@ -124,7 +124,7 @@ private static void TypeHelp()
Console.WriteLine(" basic functions of the BitcoinBlockchain class library.");
Console.WriteLine();
Console.WriteLine("USAGE:");
Console.WriteLine(" BitcoinBlockchainSample.exe /? | Path_To_Blockchain_Files");
Console.WriteLine(" BitcoinBlockchainSample.exe /? | Path_To_Blockchain_Files [First_Block_File]");
}
}
}