Forgot to add regtest byte comparison for testing if p2sh address is valid

This commit is contained in:
Chris Stewart 2015-12-23 16:55:58 -06:00
parent f29d7e6f42
commit c82d565439

View File

@ -47,7 +47,8 @@ object BitcoinAddress {
try { try {
val base58decodeChecked : Array[Byte] = Base58.decodeChecked(address) val base58decodeChecked : Array[Byte] = Base58.decodeChecked(address)
val firstByte = base58decodeChecked(0) val firstByte = base58decodeChecked(0)
((firstByte == MainNet.p2shNetworkByte || firstByte == TestNet3.p2shNetworkByte) && base58decodeChecked.size == 21) ((firstByte == MainNet.p2shNetworkByte || firstByte == TestNet3.p2shNetworkByte || RegTest.p2shNetworkByte == firstByte)
&& base58decodeChecked.size == 21)
} catch { } catch {
case _ : Throwable => false case _ : Throwable => false
} }