Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Fix OnShowPoolCommand after Mempool changes #288

Merged
merged 13 commits into from
Mar 6, 2019
16 changes: 12 additions & 4 deletions neo-cli/Shell/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -810,11 +810,19 @@ private bool OnShowCommand(string[] args)
private bool OnShowPoolCommand(string[] args)
{
bool verbose = args.Length >= 3 && args[2] == "verbose";
Transaction[] transactions = Blockchain.Singleton.GetMemoryPool().ToArray();
if (verbose)
foreach (Transaction tx in transactions)
Console.WriteLine($"{tx.Hash} {tx.GetType().Name}");
Console.WriteLine($"total: {transactions.Length}");
{
Blockchain.Singleton.MemPool.GetVerifiedAndUnverifiedTransactions(
out IEnumerable<Transaction> verifiedTransactions,
out IEnumerable<Transaction> unverifiedTransactions);
Console.WriteLine("Verified Transactions:");
foreach (Transaction tx in verifiedTransactions)
Console.WriteLine($" {tx.Hash} {tx.GetType().Name}");
Console.WriteLine("Unverified Transactions:");
foreach (Transaction tx in unverifiedTransactions)
Console.WriteLine($" {tx.Hash} {tx.GetType().Name}");
}
Console.WriteLine($"total: {Blockchain.Singleton.MemPool.Count}, total verified: {Blockchain.Singleton.MemPool.VerifiedCount}, total unverified: {Blockchain.Singleton.MemPool.UnVerifiedCount}");
return true;
}

Expand Down
5 changes: 2 additions & 3 deletions neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>2016-2019 The Neo Project</Copyright>
<AssemblyTitle>Neo.CLI</AssemblyTitle>
<Version>2.9.4</Version>
<Version>2.9.5</Version>
<Authors>The Neo Project</Authors>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>neo-cli</AssemblyName>
Expand All @@ -28,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neo" Version="2.9.4" />
<PackageReference Include="Neo" Version="2.9.5-CI00002" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.5.0" />
</ItemGroup>

Expand Down