- pub fn chain(mut self, network: Network) -> Self {
- self.refund.chain = Some(ChainHash::using_genesis_block(network));
+ pub fn chain(self, network: Network) -> Self {
+ self.chain_hash(ChainHash::using_genesis_block(network))
+ }
+
+ /// Sets the [`Refund::chain`] of the given [`ChainHash`] for paying an invoice. If not called,
+ /// [`Network::Bitcoin`] is assumed.
+ ///
+ /// Successive calls to this method will override the previous setting.
+ pub(crate) fn chain_hash(mut self, chain: ChainHash) -> Self {
+ self.refund.chain = Some(chain);