Do almost finished implementation of syncing
MODIFY
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="HBitcoin" Version="0.1.7" />
+ <PackageReference Include="HBitcoin" Version="0.1.7.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />

MODIFY
HiddenWallet/HiddenWallet.API/Models/StatusResponse.cs
HiddenWallet/HiddenWallet.API/Models/StatusResponse.cs
@@ -11,5 +11,7 @@ namespace HiddenWallet.API.Models
public string WalletState { get; set; }
public int HeaderHeight { get; set; }
public int TrackingHeight { get; set; }
+ public int ConnectedNodeCount { get; set; }
+ public int MemPoolTransactionCount { get; set; }
}
}

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/status.js
HiddenWallet/HiddenWallet.GUI/app/js/status.js
@@ -10,24 +10,47 @@ function statusShow(progress, text, progressType = "") {
var walletState;
var headerHeight;
var trackingHeight;
+var connectedNodeCount;
+var memPoolTransactionCount;
function periodicStatusUpdate() {
setInterval(function statusUpdate() {
var response = httpGetWallet("status");
+
if (walletState === response.WalletState) {
if (headerHeight === response.HeaderHeight) {
if (trackingHeight === response.TrackingHeight) {
+ if (connectedNodeCount === response.ConnectedNodeCount) {
+ if (memPoolTransactionCount === response.MemPoolTransactionCount) {
return;
}
}
}
+ }
+ }
+
walletState = response.WalletState;
headerHeight = response.HeaderHeight;
trackingHeight = response.TrackingHeight;
+ connectedNodeCount = response.ConnectedNodeCount;
+ memPoolTransactionCount = response.MemPoolTransactionCount;
- var text = "Status: " + walletState + ", Header Height: " + headerHeight + ", Tracking Height: " + trackingHeight;
- var zeroCheck = 1;
- if (trackingHeight !== 0) zeroCheck = trackingHeight;
- var progress = Math.floor((headerHeight / zeroCheck) * 100);
+ var connectionText = ", Connecting..."
+ if (connectedNodeCount !== 0) {
+ connectionText = ", Connections: " + connectedNodeCount;
+ }
+ var blocksLeft = "-";
+ if (trackingHeight !== 0) {
+ var difference = headerHeight - trackingHeight;
+ if (difference >= 0) {
+ blocksLeft = difference;
+ }
+ }
+ var text = walletState + connectionText + ", Headers: " + headerHeight + ", Blocks left: " + blocksLeft + ", MemPool txs: " + memPoolTransactionCount;
+ var zeroHeaderCheck = 1;
+ if (headerHeight !== 0) zeroHeaderCheck = headerHeight;
+ var zeroTrackingCheck = 1;
+ if (trackingHeight !== 0) zeroTrackingCheck = trackingHeight;
+ var progress = Math.floor((zeroTrackingCheck / zeroHeaderCheck) * 100);
var progressType = "";
if (walletState.toUpperCase() === "NotStarted".toUpperCase()) {
@@ -46,7 +69,8 @@ function periodicStatusUpdate() {
progressType = "success";
}
- if (progress > 50) statusShow(progress, text, progressType);
- else statusShow(50, text, progressType);
+ if (progress < 50) statusShow(50, text, progressType); //mincheck
+ else if (progress > 100) statusShow(100, text, progressType); //maxcheck
+ else statusShow(progress, text, progressType);
}, 1000);
}
\ No newline at end of file

MODIFY
HiddenWallet/HiddenWallet.GUI/index.html
HiddenWallet/HiddenWallet.GUI/index.html
<hr />
<div id="content"> </div>
</div>
- <div id="status" style="position:absolute; bottom:0px; width: 100%;"></div>
+ <div id="status" style="position:absolute; bottom:1px; width: 100%;"></div>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="app/js/decryption-phase.js"></script>

Do almost finished implementation of syncing