Class QueryChannelRange


  • public class QueryChannelRange
    extends Object
    A [`query_channel_range`] message is used to query a peer for channel UTXOs in a range of blocks. The recipient of a query makes a best effort to reply to the query using one or more [`ReplyChannelRange`] messages. [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
    • Method Detail

      • get_chain_hash

        public byte[] get_chain_hash()
        The genesis hash of the blockchain being queried
      • set_chain_hash

        public void set_chain_hash​(byte[] val)
        The genesis hash of the blockchain being queried
      • get_first_blocknum

        public int get_first_blocknum()
        The height of the first block for the channel UTXOs being queried
      • set_first_blocknum

        public void set_first_blocknum​(int val)
        The height of the first block for the channel UTXOs being queried
      • get_number_of_blocks

        public int get_number_of_blocks()
        The number of blocks to include in the query results
      • set_number_of_blocks

        public void set_number_of_blocks​(int val)
        The number of blocks to include in the query results
      • of

        public static QueryChannelRange of​(byte[] chain_hash_arg,
                                           int first_blocknum_arg,
                                           int number_of_blocks_arg)
        Constructs a new QueryChannelRange given each field
      • eq

        public boolean eq​(QueryChannelRange b)
        Checks if two QueryChannelRanges contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
      • end_blocknum

        public int end_blocknum()
        Calculates the overflow safe ending block height for the query. Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
      • write

        public byte[] write()
        Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read