Merge pull request #17 from TheBlueMatt/2021-04-upstream-confirm
[ldk-c-bindings] / lightning-c-bindings / src / bitcoin / network.rs
index 52cb2ce68a26dbdf81cccc50702568a9aa449722..0603404d51bb2594f98bc6ca40085ce9a2ac08cf 100644 (file)
@@ -1,10 +1,17 @@
+//! A C-mapped version fo bitcoin::network::constants::Network
+
 use bitcoin::network::constants::Network as BitcoinNetwork;
 
 #[repr(C)]
+/// An enum representing the possible Bitcoin or test networks which we can run on
 pub enum Network {
+       /// The main Bitcoin blockchain.
        Bitcoin,
+       /// The testnet3 blockchain.
        Testnet,
+       /// A local test blockchain.
        Regtest,
+       /// A blockchain on which blocks are signed instead of mined.
        Signet,
 }
 
@@ -17,7 +24,7 @@ impl Network {
                        Network::Signet => BitcoinNetwork::Signet,
                }
        }
-       pub(crate) fn from_bitcoin(net: BitcoinNetwork) -> Self {
+       pub(crate) fn from_bitcoin(net: &BitcoinNetwork) -> Self {
                match net {
                        BitcoinNetwork::Bitcoin => Network::Bitcoin,
                        BitcoinNetwork::Testnet => Network::Testnet,