示例#1
0
        public void ReadWrite(BitcoinStream stream)
        {
            stream.ReadWrite(ref SerializeType);
            switch (SerializeType)
            {
            case 0:
                /* Null entry, used to signal "no vote" proposal */
                break;

            case 1:
                stream.ReadWrite(ref SignBlockScript);
                stream.ReadWrite(ref SignBlockWitnessLimit);
                break;

            case 2:
                stream.ReadWrite(ref SignBlockScript);
                stream.ReadWrite(ref SignBlockWitnessLimit);
                stream.ReadWrite(ref FedPegProgram);
                stream.ReadWrite(ref FedPegScript);
                stream.ReadWriteListBytes(ref ExtensionSpace);
                break;

            default:
                throw new FormatException("Invalid consensus parameter entry type");
            }
        }