Ejemplo n.º 1
0
 public BalanceQuery()
 {
     From         = new UnconfirmedBalanceLocator();
     To           = new ConfirmedBalanceLocator(0);
     ToIncluded   = true;
     FromIncluded = true;
 }
Ejemplo n.º 2
0
        public override BalanceLocator Ceil()
        {
            ConfirmedBalanceLocator result = this;

            if (TransactionId == null)
            {
                result = new ConfirmedBalanceLocator(result.Height, result.BlockHash, _MaxUInt256);
            }

            if (BlockHash == null)
            {
                result = new ConfirmedBalanceLocator(result.Height, _MaxUInt256, result.TransactionId);
            }
            return(result);
        }
Ejemplo n.º 3
0
        public static BalanceLocator Parse(string str, bool queryFormat)
        {
            var splitted = str.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);

            if (splitted.Length == 0)
            {
                throw new FormatException("Invalid BalanceLocator string");
            }
            var height = queryFormat ? Helper.StringToHeight(splitted[0]) : int.Parse(splitted[0]);

            if (height == UnconfirmedBalanceLocator.UnconfHeight)
            {
                return(UnconfirmedBalanceLocator.ParseCore(splitted, queryFormat));
            }
            else
            {
                return(ConfirmedBalanceLocator.ParseCore(height, splitted));
            }
        }