Add necessary requirements to lcal connection
MODIFY
WalletWasabi/Helpers/Constants.cs
WalletWasabi/Helpers/Constants.cs
@@ -22,6 +22,13 @@ namespace WalletWasabi.Helpers
MinProtocolCapabilities = new ProtocolCapabilities { SupportGetBlock = true, SupportWitness = true, SupportMempoolQuery = true }
};
+ public static readonly NodeRequirement LocalNodeRequirements = new NodeRequirement
+ {
+ RequiredServices = NodeServices.NODE_WITNESS,
+ MinVersion = ProtocolVersion_WITNESS_VERSION,
+ MinProtocolCapabilities = new ProtocolCapabilities { SupportGetBlock = true, SupportWitness = true }
+ };
+
public const int P2wpkhInputSizeInBytes = 41;
public const int P2pkhInputSizeInBytes = 145;
public const int OutputSizeInBytes = 33;

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -642,6 +642,22 @@ namespace WalletWasabi.Services
{
DisconnectDisposeNullLocalBitcoinCoreNode();
LocalBitcoinCoreNode = Node.ConnectToLocal(Network);
+ if(LocalBitcoinCoreNode.IsConnected)
+ {
+ try
+ {
+ LocalBitcoinCoreNode.VersionHandshake(Constants.LocalNodeRequirements);
+ }
+ catch(Exception)
+ {
+ Logger.LogTrace<WalletService>("It connected to local node but it couldn't finish the version handshake. Local node could not meet the needed requirements.");
+ throw;
+ }
+ if(LocalBitcoinCoreNode.State != NodeState.HandShaked)
+ {
+ throw new InvalidOperationException($"Local node is not in handshaked state. Ignoring local node.");
+ }
+ }
}
Block blockFromLocalNode = null;

Add necessary requirements to lcal connection