Skip to content

Commit

Permalink
xsbc-0.5.7-PR1
Browse files Browse the repository at this point in the history
  • Loading branch information
IxiAngel committed Oct 25, 2024
1 parent 7cfb79c commit 605a467
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 92 deletions.
2 changes: 1 addition & 1 deletion SpixiBot/Meta/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Config
public static List<Address> whiteList = new List<Address>();

// Read-only values
public static readonly string version = "xsbc-0.5.6-PR1"; // Spixi Bot version
public static readonly string version = "xsbc-0.5.7-PR1"; // Spixi Bot version

public static readonly string pushServiceUrl = "https://ipn.ixian.io/v1";

Expand Down
12 changes: 1 addition & 11 deletions SpixiBot/Meta/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,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;
Expand All @@ -656,16 +656,6 @@ public override byte[] getBlockHash(ulong blockNum)
return b.blockChecksum;
}

public override byte[] calculateRegNameChecksumFromUpdatedDataRecords(byte[] name, List<RegisteredNameDataRecord> 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();
Expand Down
80 changes: 0 additions & 80 deletions SpixiBot/Network/NetworkProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,6 @@ public static void parseProtocolMessage(ProtocolMessageCode code, byte[] data, R
}
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);
Expand Down Expand Up @@ -171,36 +155,6 @@ public static void parseProtocolMessage(ProtocolMessageCode code, byte[] data, R
}
break;

case ProtocolMessageCode.getPresence:
{
using (MemoryStream m = new MemoryStream(data))
{
using (BinaryReader reader = new BinaryReader(m))
{
int walletLen = reader.ReadInt32();
Address wallet = new Address(reader.ReadBytes(walletLen));
Presence p = PresenceList.getPresenceByAddress(wallet);
if (p != null)
{
lock (p)
{
byte[][] presence_chunks = p.getByteChunks();
foreach (byte[] presence_chunk in presence_chunks)
{
endpoint.sendData(ProtocolMessageCode.updatePresence, presence_chunk, null);
}
}
}
else
{
// TODO blacklisting point
Logging.warn(string.Format("Node has requested presence information about {0} that is not in our PL.", wallet.ToString()));
}
}
}
}
break;

case ProtocolMessageCode.getPresence2:
{
using (MemoryStream m = new MemoryStream(data))
Expand Down Expand Up @@ -231,40 +185,6 @@ public static void parseProtocolMessage(ProtocolMessageCode code, byte[] data, R
}
break;

case ProtocolMessageCode.balance:
{
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 = new IxiNumber(reader.ReadString());

if (address.addressNoChecksum.SequenceEqual(IxianHandler.getWalletStorage().getPrimaryAddress().addressNoChecksum))
{
// 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;
}
}
}
}
}
break;

case ProtocolMessageCode.balance2:
{
using (MemoryStream m = new MemoryStream(data))
Expand Down

0 comments on commit 605a467

Please sign in to comment.