Main Balance
-
+
@totalBalance()
@this.Network.CoinTicker.ToUpper()
@@ -34,6 +34,7 @@
+
@{
if (this.StakingEnabled)
{
@@ -48,50 +49,49 @@
Staking disabled
}
-
-
-
-
-
- Wallet
- Main balance (unconfirmed)
- @* Hot balance (unconfirmed) *@
-
-
-
- @{
- foreach (var walletName in this.WalletManager.GetWalletsNames())
- {
- foreach (var account in this.WalletManager.GetAccounts(walletName))
- {
- var mainAccountBalance = this.WalletManager.GetBalances(walletName, account.Name).Single();
-
- { SetWalletName(walletName); }">
- @walletName
- @if (@mainAccountBalance.AmountUnconfirmed >0) {
- @mainAccountBalance.AmountConfirmed (@mainAccountBalance.AmountUnconfirmed )
- } else {
- @mainAccountBalance.AmountConfirmed
- }
-
- @* var hotStakingAccount = ColdStakingManager.GetColdStakingAccount(this.WalletManager.GetWallet(walletName), false);
-
- if (hotStakingAccount != null) {
- var hotAccountBalance = ColdStakingManager.GetBalances(walletName, hotStakingAccount.Name).Single();
- @if (@hotAccountBalance.AmountUnconfirmed >0) {
- @hotAccountBalance.AmountConfirmed (@hotAccountBalance.AmountUnconfirmed )
- } else {
- @hotAccountBalance.AmountConfirmed
- }
- } *@
-
- }
- }
- }
-
-
-
-
+
+
+
+
+
Staking Wallets
+
+
+
+
+ WALLET
+ BALANCE (UNCONFIRMED)
+
+
+
+ @{
+ foreach (var walletName in this.WalletManager.GetWalletsNames())
+ {
+ var items = this.WalletManager.GetSpendableTransactionsInWalletForStaking(walletName, 0);
+
+ var amountConfirmed = items.Where(s => s.Confirmations > 0).Sum(s => s.Transaction.Amount);
+ var amountUnconfirmed = items.Where(s => s.Confirmations <= 0).Sum(s => s.Transaction.Amount);
+
+ { SetWalletName(walletName); }">
+ @walletName
+ @if (amountUnconfirmed > 0)
+ {
+ @Money.Satoshis(amountConfirmed) (@Money.Satoshis(amountUnconfirmed))
+ }
+ else
+ {
+ @Money.Satoshis(amountConfirmed)
+ }
+
+
+ }
+ }
+
+
+
+
+
+
+
if (!this.StakingEnabled)
{
}
-
@@ -126,7 +150,6 @@
@code
{
-
string Alert { get; set; }
private string WalletName { get; set; }
@@ -137,6 +160,11 @@
private string StakingInfo { get; set; }
+ @* private string StakingWeight { get; set; }
+ private string NetworkWeight { get; set; }
+ private string StakingPercent { get; set; }
+ private string StakingTime { get; set; } *@
+
protected override void OnInitialized()
{
this.LoadStats();
@@ -154,6 +182,11 @@
this.StakingInfo = $"Node staking with {new Money(model.Weight)} ({ourPercent:0.00} % of the network weight {new Money(model.NetStakeWeight)}), " +
$"est. time to find new block is {TimeSpan.FromSeconds(model.ExpectedTime)}.";
+
+ @* this.StakingWeight = $"{new Money(model.Weight)}";
+ this.NetworkWeight = $"{new Money(model.NetStakeWeight)}";
+ this.StakingPercent = $"{ourPercent:0.00}";
+ this.StakingTime = $"{TimeSpan.FromSeconds(model.ExpectedTime)}"; *@
}
else
{
@@ -176,32 +209,31 @@
private dynamic totalBalance()
{
dynamic balance = 0;
- foreach (var walletName in this.WalletManager.GetWalletsNames())
- {
- foreach (var account in this.WalletManager.GetAccounts(walletName))
- {
- var accountBalance = this.WalletManager.GetBalances(walletName, account.Name).Single();
- balance = balance + accountBalance.AmountConfirmed;
- }
- }
+ foreach (var walletName in this.WalletManager.GetWalletsNames())
+ {
+ var items = this.WalletManager.GetSpendableTransactionsInWalletForStaking(walletName, 1);
+ var amountConfirmed = items.Where(s => s.Confirmations > 0).Sum(s => s.Transaction.Amount);
+
+ var accountBalance = Money.Satoshis(amountConfirmed);
+ balance = balance + accountBalance;
+ }
return balance;
}
private dynamic totalUnconfirmedBalance()
{
dynamic balance = 0;
- foreach (var walletName in this.WalletManager.GetWalletsNames())
- {
- foreach (var account in this.WalletManager.GetAccounts(walletName))
- {
- var accountBalance = this.WalletManager.GetBalances(walletName, account.Name).Single();
- balance = balance + accountBalance.AmountUnconfirmed;
- }
- }
+ foreach (var walletName in this.WalletManager.GetWalletsNames())
+ {
+ var items = this.WalletManager.GetSpendableTransactionsInWalletForStaking(walletName, 0);
+ var amountConfirmed = items.Where(s => s.Confirmations <= 0).Sum(s => s.Transaction.Amount);
+
+ var accountBalance = Money.Satoshis(amountConfirmed);
+ balance = balance + accountBalance;
+ }
return balance;
}
-
private void StartStaking()
{
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
diff --git a/src/Features/Blockcore.Features.NodeHost/UI/Pages/Index.razor b/src/Features/Blockcore.Features.NodeHost/UI/Pages/Index.razor
index 88005f772..4fdf5b4ef 100644
--- a/src/Features/Blockcore.Features.NodeHost/UI/Pages/Index.razor
+++ b/src/Features/Blockcore.Features.NodeHost/UI/Pages/Index.razor
@@ -10,18 +10,23 @@
@inject NavigationManager NavigationManager
-
@this.Network.CoinTicker.ToUpper() Node
+
@this.Network.CoinTicker.ToUpper() Network
-
@@ -29,70 +34,151 @@
@{
+ if (this.InitialBlockDownloadState.IsInitialBlockDownload())
+ {
+
Currently processing the IBD (initial block download) & syncing your node with the network
+ }
-if (this.InitialBlockDownloadState.IsInitialBlockDownload())
-{
-
Currently processing the IBD (initial block download) & syncing your node with the network
-}
+
+
+
+
+
+
+
+
@this.Network.CoinTicker.ToUpper()
+
+
+
+
+
+
Network
+
+
+
+
+
+
+
+
+
+
@this.ConnectionManager.ConnectedPeers.Count()
+
+
+
+
+
+
Peers
+
+
+
+
+
+
+
+
+
+ @if (this.InitialBlockDownloadState.IsInitialBlockDownload())
+ {
+
+ }
+ else
+ {
+
+ }
+
+
+
+
+
+
Chain Synced
+
+
+
+
+
+
+
+
+
+
@this.ChainIndexer.Tip.Height
+
+
+
+
+
+
Network Height
+
+
+
+
-
-
-
-
-
-
-
-
- Connected peers:
- @this.ConnectionManager.ConnectedPeers.Count()
-
-
- Current tip at height:
- @this.ChainIndexer.Tip.Height
-
-
- Current tip Hash:
- @this.ChainIndexer.Tip.HashBlock
-
-
-
+
+
+
+
+
+
+
+
+ Current tip Hash:
+ @this.ChainIndexer.Tip.HashBlock
+
+
+
+
-
-
-
-
-
-
-
-
-
- IP Address
- Inbound
- Agent
- Version
-
-
-
- @foreach (var peer in this.ConnectionManager.ConnectedPeers)
- {
+
+
+
+
+
+
+
- @peer.RemoteSocketEndpoint.ToString()
- @peer.Inbound
- @peer.PeerVersion?.UserAgent
- @peer.PeerVersion?.Version
+ IP ADDRESS
+ CONNECTION
+ AGENT
+ VERSION
- }
-
-
+
+
+ @foreach (var peer in this.ConnectionManager.ConnectedPeers)
+ {
+
+ @peer.RemoteSocketEndpoint.ToString()
+ @(peer.Inbound ? "Inbound" : "Outbound")
+ @peer.PeerVersion?.UserAgent
+ @peer.PeerVersion?.Version
+
+ }
+
+
+
-
}
@code
{
@@ -118,4 +204,4 @@ if (this.InitialBlockDownloadState.IsInitialBlockDownload())
{
NavigationManager.NavigateTo("logs");
}
-}
+}
\ No newline at end of file
diff --git a/src/Features/Blockcore.Features.NodeHost/UI/Shared/MainLayout.razor b/src/Features/Blockcore.Features.NodeHost/UI/Shared/MainLayout.razor
index c06e01133..3fda61f89 100644
--- a/src/Features/Blockcore.Features.NodeHost/UI/Shared/MainLayout.razor
+++ b/src/Features/Blockcore.Features.NodeHost/UI/Shared/MainLayout.razor
@@ -5,16 +5,14 @@
\ No newline at end of file
diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor
index 3b9b5bb97..9d5dfa56f 100644
--- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor
+++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor
@@ -13,10 +13,13 @@
var accountBalance = this.WalletManager.GetBalances(walletname, accountname).Single();
-
Wallet Account: @walletname
+
Wallet - @walletname
- { NavigateToReceiveWallet(walletname, accountname); }" >Receive
- { NavigateToSendWallet(walletname, accountname); }" >Send
+ { NavigateToReceiveWallet(walletname, accountname); }" >
+ Receive
+ { NavigateToSendWallet(walletname, accountname); }" >
+ Send
+
@@ -50,10 +53,10 @@ var model = WalletModelBuilder.GetHistory(this.WalletManager, Network, new Walle
- TYPE
- DATE/TIME
- AMOUNT
- BLOCK
+ TYPE
+ DATE/TIME
+ AMOUNT
+ BLOCK
@@ -63,9 +66,9 @@ var model = WalletModelBuilder.GetHistory(this.WalletManager, Network, new Walle
{
@*@onclick="() => { NavigateToViewTx(transaction.Id); }" > *@
@transaction.Type
- @String.Format("{0:f}", transaction.Timestamp)
- @transaction.Amount
- @transaction.ConfirmedInBlock
+ @String.Format("{0:f}", transaction.Timestamp)
+ @transaction.Amount
+ @transaction.ConfirmedInBlock
}
}
diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletBroadcastTx.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletBroadcastTx.razor
index 092fb312f..a12f416cd 100644
--- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletBroadcastTx.razor
+++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletBroadcastTx.razor
@@ -16,7 +16,7 @@
-
Broadcast Transaction from: @walletname
+
Broadcast Transaction from @walletname
diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor
index 5cbb91524..79c76b37a 100644
--- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor
+++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor
@@ -8,7 +8,7 @@
@inject NavigationManager NavigationManager
-
Receive to: @walletname
+
Receive to @walletname
diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor
index 7714f2a4b..ff395abb2 100644
--- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor
+++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor
@@ -15,109 +15,116 @@
@inject IBroadcasterManager BroadcasterManager
@{
-
-
Send coins from: @walletname
-
-
-var accountBalance = this.WalletManager.GetBalances(walletname, accountname).Single();
-
-
-
-
-
Main Balance
-
-
-
-
@accountBalance.AmountConfirmed
-
@this.Network.CoinTicker.ToUpper()
+
+ var accountBalance = this.WalletManager.GetBalances(walletname, accountname).Single();
+
+
+
+
+
Main Balance
+
+
+
+
@accountBalance.AmountConfirmed
+
@this.Network.CoinTicker.ToUpper()
+
+
@accountBalance.AmountUnconfirmed (unconfirmed)
-
@accountBalance.AmountUnconfirmed (unconfirmed)
-
-
-