public BalanceQuery()
 {
     From         = new UnconfirmedBalanceLocator();
     To           = new ConfirmedBalanceLocator(0);
     ToIncluded   = true;
     FromIncluded = true;
 }
        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);
        }
        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));
            }
        }
 public BalanceQuery()
 {
     From = new UnconfirmedBalanceLocator();
     To = new ConfirmedBalanceLocator(0);
     ToIncluded = true;
     FromIncluded = true;
 }
        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;
        }