Skip to content

Sign transaction will throw a OutOfMemoryException because fall into deal loop. #2

@kinsen

Description

@kinsen

https://github.com/BitsumFoundation/NEos/blob/master/Eos.Api/Extensions/BinaryWriterExtension.cs

using System.IO;

namespace Eos
{
    public static class BinaryWriterExtension
    {
        public static void WriteVarUInt32(this BinaryWriter writer, uint value)
        {
            while (true)
            {
                var val = (byte)(value & 0x7f);
                var remaining = (byte)(value >> 7);

                if (remaining > 0)
                {
                    writer.Write((byte)(0x80 | val));
                    // i add below code.
                    value = value >> 7;
                }
                else
                {
                    writer.Write(val);
                    break;
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions