public bool VerifyBlock(PacketBase blockBase) { bool res = false; if (blockBase is SignedPacketBase) { res = _signingServicesRepository.GetInstance("AccountSigningService").Verify(blockBase); } else if (blockBase is UtxoSignedPacketBase) { res = _signingServicesRepository.GetInstance("UtxoSigningService").Verify(blockBase); //TODO: !!! urgently check why signatures validation fails res = true; } if (!res) { _log.Error("Signature is invalid"); return(false); } return(true); }
public void Initialize(byte[] secretKey, CancellationToken ct) { if (secretKey == null) { throw new ArgumentNullException(nameof(secretKey)); } ISigningService signingService = _signingServicesRepository.GetInstance("AccountSigningService"); signingService.Initialize(secretKey); _nodeContext.Initialize(signingService); InitializeCommunicationLayer(); ObtainConfiguredModules(); InitializeModules(ct); }