Skip to content

Commit

Permalink
Make testnet4 magic constant
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Oct 12, 2024
1 parent 055aba1 commit 79fa1e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,17 @@ pub const LIQUID_TESTNET_PARAMS: address::AddressParams = address::AddressParams
blech_hrp: "tlq",
};

/// Magic for testnet4, 0x1c163f28 (from BIP94) with flipped endianness.
#[cfg(not(feature = "liquid"))]
const TESTNET4_MAGIC: u32 = 0x283f161c;

impl Network {
#[cfg(not(feature = "liquid"))]
pub fn magic(self) -> u32 {
BNetwork::from(self).magic()
match self {
Self::Testnet4 => TESTNET4_MAGIC,
_ => BNetwork::from(self).magic(),
}
}

#[cfg(feature = "liquid")]
Expand Down
2 changes: 0 additions & 2 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ case "${1}" in
;;
testnet4)
NETWORK=testnet4
MAGIC=283f161c
THREADS=$((NPROC / 6))
;;
signet)
Expand Down Expand Up @@ -157,7 +156,6 @@ do
--precache-threads "${THREADS}" \
--cookie "${RPC_USER}:${RPC_PASS}" \
--cors '*' \
--magic "${MAGIC}" \
--address-search \
--utxos-limit "${UTXOS_LIMIT}" \
--electrum-txs-limit "${ELECTRUM_TXS_LIMIT}" \
Expand Down

0 comments on commit 79fa1e8

Please sign in to comment.