diff --git a/src/Stratis.Bitcoin.Features.Api/ApiSettings.cs b/src/Stratis.Bitcoin.Features.Api/ApiSettings.cs
index 849c3f239e..9da40fb082 100644
--- a/src/Stratis.Bitcoin.Features.Api/ApiSettings.cs
+++ b/src/Stratis.Bitcoin.Features.Api/ApiSettings.cs
@@ -19,7 +19,7 @@ public class ApiSettings : BaseSettings
private string apiHost = DefaultApiHost;
// If a port is set in the -apiuri, it takes precedence over the default port or the port passed in -apiport.
- public Uri ApiUri { get { Uri uri = new Uri(this.ApiHost); return uri.IsDefaultPort ? new Uri($"{this.ApiHost}:{this.apiPort ?? this.nodeSettings.Network.DefaultAPIPort}") : uri; } }
+ public Uri ApiUri { get { Uri uri = new Uri(this.ApiHost); return uri.IsDefaultPort ? new Uri($"{this.ApiHost}:{this.apiPort ?? this.NodeSettings.Network.DefaultAPIPort}") : uri; } }
/// Port of node's API interface.
[CommandLineOption("apiport", "Port of node's API interface.")]
diff --git a/src/Stratis.Bitcoin.Features.Miner/MinerSettings.cs b/src/Stratis.Bitcoin.Features.Miner/MinerSettings.cs
index 01386b2512..0cd07dda37 100644
--- a/src/Stratis.Bitcoin.Features.Miner/MinerSettings.cs
+++ b/src/Stratis.Bitcoin.Features.Miner/MinerSettings.cs
@@ -67,11 +67,11 @@ public class MinerSettings : BaseSettings
public string WalletName { get; set; } = null;
[CommandLineOption("blockmaxsize", "Maximum block size (in bytes) for the miner to generate.")]
- private uint BlockMaxSize { get { return this.blockMaxSize ?? this.nodeSettings.Network.Consensus.Options.MaxBlockSerializedSize; } set { this.blockMaxSize = value; } }
+ private uint BlockMaxSize { get { return this.blockMaxSize ?? this.NodeSettings.Network.Consensus.Options.MaxBlockSerializedSize; } set { this.blockMaxSize = value; } }
private uint? blockMaxSize = null;
[CommandLineOption("blockmaxweight", "Maximum block weight (in weight units) for the miner to generate.")]
- private uint BlockMaxWeight { get { return this.blockMaxWeight ?? this.nodeSettings.Network.Consensus.Options.MaxBlockWeight; } set { this.blockMaxWeight = value; } }
+ private uint BlockMaxWeight { get { return this.blockMaxWeight ?? this.NodeSettings.Network.Consensus.Options.MaxBlockWeight; } set { this.blockMaxWeight = value; } }
private uint? blockMaxWeight = null;
[CommandLineOption("blockmintxfee", "Set lowest fee rate (in BTC/kvB) for transactions to be included in block creation.")]
diff --git a/src/Stratis.Bitcoin/Configuration/NodeSettings.cs b/src/Stratis.Bitcoin/Configuration/NodeSettings.cs
index c0d1990e0b..508e548751 100644
--- a/src/Stratis.Bitcoin/Configuration/NodeSettings.cs
+++ b/src/Stratis.Bitcoin/Configuration/NodeSettings.cs
@@ -48,7 +48,7 @@ public class NodeSettings : IDisposable
/// A factory responsible for creating a Full Node logger instance.
public ILoggerFactory LoggerFactory
- {
+ {
get
{
if (loggerFactory == null)
diff --git a/src/Stratis.Bitcoin/Configuration/Settings/BaseSettings.cs b/src/Stratis.Bitcoin/Configuration/Settings/BaseSettings.cs
index d5ab601807..3116ef865c 100644
--- a/src/Stratis.Bitcoin/Configuration/Settings/BaseSettings.cs
+++ b/src/Stratis.Bitcoin/Configuration/Settings/BaseSettings.cs
@@ -30,7 +30,7 @@ public CommandLineOptionAttribute(string option, string description, bool canLog
public abstract class BaseSettings
{
- protected readonly NodeSettings nodeSettings;
+ protected NodeSettings NodeSettings { get; private set; }
private static string TypeDescription(Type type)
{
@@ -62,7 +62,7 @@ public BaseSettings(NodeSettings nodeSettings)
{
Guard.NotNull(nodeSettings, nameof(nodeSettings));
- this.nodeSettings = nodeSettings;
+ this.NodeSettings = nodeSettings;
ILogger logger = nodeSettings.LoggerFactory.CreateLogger(this.GetType().FullName);
diff --git a/src/Stratis.Bitcoin/Controllers/Models/AddressBalancesResult.cs b/src/Stratis.Bitcoin/Controllers/Models/AddressBalancesResult.cs
index 675c596685..488ae4b350 100644
--- a/src/Stratis.Bitcoin/Controllers/Models/AddressBalancesResult.cs
+++ b/src/Stratis.Bitcoin/Controllers/Models/AddressBalancesResult.cs
@@ -136,7 +136,7 @@ public static long CalculateMinBalance(this IEnumerable ba
foreach (AddressBalanceChange change in balancesByHeight)
{
balance += change.Satoshi;
-
+
if (change.BalanceChangedHeight < startHeight)
continue;
diff --git a/src/Stratis.Bitcoin/Database/ReadWriteBatch.cs b/src/Stratis.Bitcoin/Database/ReadWriteBatch.cs
index 6964019b48..d414ae72fc 100644
--- a/src/Stratis.Bitcoin/Database/ReadWriteBatch.cs
+++ b/src/Stratis.Bitcoin/Database/ReadWriteBatch.cs
@@ -7,7 +7,7 @@ namespace Stratis.Bitcoin.Database
///
/// A batch that can be used to record changes that can be applied atomically.
///
- /// The supplied method will immediately reflect any changes that have
+ /// The supplied method will immediately reflect any changes that have
/// been made or retrieve the value from the underlying database. In contrast the database method
/// will only show the changes after the method is called.
public class ReadWriteBatch : IDbBatch
diff --git a/src/Stratis.Bitcoin/EventBus/CoreEvents/ConsensusManagerStatusEvent.cs b/src/Stratis.Bitcoin/EventBus/CoreEvents/ConsensusManagerStatusEvent.cs
index e84a06aa80..b9adb898e2 100644
--- a/src/Stratis.Bitcoin/EventBus/CoreEvents/ConsensusManagerStatusEvent.cs
+++ b/src/Stratis.Bitcoin/EventBus/CoreEvents/ConsensusManagerStatusEvent.cs
@@ -1,13 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Stratis.Bitcoin.EventBus.CoreEvents
+namespace Stratis.Bitcoin.EventBus.CoreEvents
{
public class ConsensusManagerStatusEvent : EventBase
{
- public readonly bool IsIbd;
- public readonly int? HeaderHeight;
+ public bool IsIbd { get; private set; }
+
+ public int? HeaderHeight { get; private set; }
public ConsensusManagerStatusEvent(bool isIbd, int? headerHeight)
{
diff --git a/src/Stratis.Bitcoin/Persistence/KeyValueStores/KeyValueRepository.cs b/src/Stratis.Bitcoin/Persistence/KeyValueStores/KeyValueRepository.cs
index 0967df60e1..da209550a9 100644
--- a/src/Stratis.Bitcoin/Persistence/KeyValueStores/KeyValueRepository.cs
+++ b/src/Stratis.Bitcoin/Persistence/KeyValueStores/KeyValueRepository.cs
@@ -8,7 +8,7 @@
namespace Stratis.Bitcoin.Persistence.KeyValueStores
{
- public class KeyValueRepository : IKeyValueRepository where T : IDb, new()
+ public class KeyValueRepository : IKeyValueRepository where TDB : IDb, new()
{
/// Access to database.
private readonly IDb db;
@@ -25,7 +25,7 @@ public KeyValueRepository(string folder, DBreezeSerializer dBreezeSerializer)
this.dBreezeSerializer = dBreezeSerializer;
// Open a connection to a new DB and create if not found
- this.db = new T();
+ this.db = new TDB();
this.db.Open(folder);
}