/// </summary>
public class CBlock
{
+ /// <summary>
+ /// Maximum block size is 1Mb.
+ /// </summary>
+ public const uint nMaxBlockSize = 1000000;
+
/// <summary>
/// Block header.
/// </summary>
uint nSigOps = 0; // total sigops
// Basic sanity checkings
- if (vtx.Length == 0 || Size > 1000000)
+ if (vtx.Length == 0 || Size > nMaxBlockSize)
{
return false;
}
/// <returns>Result</returns>
public bool ReadFromFile(ref Stream reader, out CTransaction tx)
{
- var buffer = new byte[250000]; // Max transaction size is 250kB
+ var buffer = new byte[CTransaction.nMaxTxSize];
tx = null;
try
var nOffset = 0L;
- var buffer = new byte[1000000]; // Max block size is 1Mb
+ var buffer = new byte[CBlock.nMaxBlockSize]; // Max block size is 1Mb
var intBuffer = new byte[4];
var fStream2 = File.OpenRead(BlockFile);
public const ulong nMaxMoney = 2000000000 * nCoin;
/// <summary>
+ /// Maximum transaction size is 250Kb
+ /// </summary>
+ public const uint nMaxTxSize = 250000;
+
+ /// <summary>
/// Version of transaction schema.
/// </summary>
public uint nVersion;
/// <returns>Checking result</returns>
public bool CheckTransaction()
{
- if (Size > 250000 || vin.Length == 0 || vout.Length == 0)
+ if (Size > nMaxTxSize || vin.Length == 0 || vout.Length == 0)
{
return false;
}