From 9fd9467d47cd61303d21fb240feb13495f60440f Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 25 Oct 2024 22:19:32 +0200 Subject: [PATCH] xs2c-0.5.3 --- IxianS2/Meta/Config.cs | 2 +- IxianS2/Meta/Node.cs | 12 +------ IxianS2/Network/NetworkProtocol.cs | 57 ------------------------------ 3 files changed, 2 insertions(+), 69 deletions(-) diff --git a/IxianS2/Meta/Config.cs b/IxianS2/Meta/Config.cs index 946f6a7..1afee04 100644 --- a/IxianS2/Meta/Config.cs +++ b/IxianS2/Meta/Config.cs @@ -45,7 +45,7 @@ public class Config public static string externalIp = ""; // Read-only values - public static readonly string version = "xs2c-0.5.2"; // S2 Node version + public static readonly string version = "xs2c-0.5.3"; // S2 Node version public static readonly string checkVersionUrl = "https://www.ixian.io/s2-update.txt"; public static readonly int checkVersionSeconds = 6 * 60 * 60; // 6 hours diff --git a/IxianS2/Meta/Node.cs b/IxianS2/Meta/Node.cs index bfc160c..443ac45 100644 --- a/IxianS2/Meta/Node.cs +++ b/IxianS2/Meta/Node.cs @@ -589,7 +589,7 @@ public override Block getBlockHeader(ulong blockNum) return BlockHeaderStorage.getBlockHeader(blockNum); } - public override IxiNumber getMinSignerPowDifficulty(ulong blockNum) + public override IxiNumber getMinSignerPowDifficulty(ulong blockNum, long curBlockTimestamp) { // TODO TODO implement this properly return ConsensusConfig.minBlockSignerPowDifficulty; @@ -606,16 +606,6 @@ public override byte[] getBlockHash(ulong blockNum) return b.blockChecksum; } - public override byte[] calculateRegNameChecksumFromUpdatedDataRecords(byte[] name, List dataRecords, ulong sequence, Address nextPkHash) - { - throw new NotImplementedException(); - } - - public override byte[] calculateRegNameChecksumForRecovery(byte[] name, Address recoveryHash, ulong sequence, Address nextPkHash) - { - throw new NotImplementedException(); - } - public override RegisteredNameRecord getRegName(byte[] name, bool useAbsoluteId) { throw new NotImplementedException(); diff --git a/IxianS2/Network/NetworkProtocol.cs b/IxianS2/Network/NetworkProtocol.cs index 1605c42..dc8418d 100644 --- a/IxianS2/Network/NetworkProtocol.cs +++ b/IxianS2/Network/NetworkProtocol.cs @@ -44,22 +44,6 @@ public static void parseProtocolMessage(ProtocolMessageCode code, byte[] data, R StreamProcessor.receivedTransactionSignature(data, endpoint); break; - case ProtocolMessageCode.transactionData: - { - Transaction tx = new Transaction(data, true); - - if (endpoint.presenceAddress.type == 'M' || endpoint.presenceAddress.type == 'H') - { - PendingTransactions.increaseReceivedCount(tx.id, endpoint.presence.wallet); - } - - Node.tiv.receivedNewTransaction(tx); - Logging.info("Received new transaction {0}", tx.id); - - Node.addTransactionToActivityStorage(tx); - } - break; - case ProtocolMessageCode.transactionData2: { Transaction tx = new Transaction(data, true, true); @@ -89,18 +73,10 @@ public static void parseProtocolMessage(ProtocolMessageCode code, byte[] data, R bool updated = PresenceList.receiveKeepAlive(data, out address, out last_seen, out device_id, endpoint); break; - case ProtocolMessageCode.getPresence: - handleGetPresence(data, endpoint); - break; - case ProtocolMessageCode.getPresence2: handleGetPresence2(data, endpoint); break; - case ProtocolMessageCode.balance: - handleBalance(data, endpoint); - break; - case ProtocolMessageCode.balance2: handleBalance2(data, endpoint); break; @@ -257,39 +233,6 @@ static void handleGetPresence2(byte[] data, RemoteEndpoint endpoint) } } - static void handleBalance(byte[] data, RemoteEndpoint endpoint) - { - using (MemoryStream m = new MemoryStream(data)) - { - using (BinaryReader reader = new BinaryReader(m)) - { - int address_length = reader.ReadInt32(); - Address address = new Address(reader.ReadBytes(address_length)); - - // Retrieve the latest balance - IxiNumber balance = reader.ReadString(); - - if (address.SequenceEqual(IxianHandler.getWalletStorage().getPrimaryAddress())) - { - // Retrieve the blockheight for the balance - ulong block_height = reader.ReadUInt64(); - - if (block_height > Node.balance.blockHeight && (Node.balance.balance != balance || Node.balance.blockHeight == 0)) - { - byte[] block_checksum = reader.ReadBytes(reader.ReadInt32()); - - Node.balance.address = address; - Node.balance.balance = balance; - Node.balance.blockHeight = block_height; - Node.balance.blockChecksum = block_checksum; - Node.balance.lastUpdate = Clock.getTimestamp(); - Node.balance.verified = false; - } - } - } - } - } - static void handleBalance2(byte[] data, RemoteEndpoint endpoint) { using (MemoryStream m = new MemoryStream(data))