diff --git a/NBitcoin/Network.cs b/NBitcoin/Network.cs index 3507d7a6a5..c758d4f478 100644 --- a/NBitcoin/Network.cs +++ b/NBitcoin/Network.cs @@ -2092,7 +2092,7 @@ public INetworkSet NetworkSet internal static Network Register(NetworkBuilder builder) { if (builder._Name == null) - throw new InvalidOperationException("A network name need to be provided"); + throw new InvalidOperationException("A network name needs to be provided"); if (GetNetwork(builder._Name) != null) throw new InvalidOperationException("The network " + builder._Name + " is already registered"); Network network = new Network(builder._Name, builder._Genesis.ToArray(), builder._Magic, builder._UriScheme, builder._NetworkSet); @@ -2369,33 +2369,6 @@ private static IEnumerable LoadNetworkAddresses(byte[] payload) } } #endif - private Block CreateGenesisBlock(uint nTime, uint nNonce, uint nBits, int nVersion, Money genesisReward) - { - string pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; - Script genesisOutputScript = new Script(Op.GetPushOp(Encoders.Hex.DecodeData("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f")), OpcodeType.OP_CHECKSIG); - return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward); - } - - private Block CreateGenesisBlock(string pszTimestamp, Script genesisOutputScript, uint nTime, uint nNonce, uint nBits, int nVersion, Money genesisReward) - { - Transaction txNew = Consensus.ConsensusFactory.CreateTransaction(); - txNew.Version = 1; - txNew.Inputs.Add(scriptSig: new Script(Op.GetPushOp(486604799), new Op() - { - Code = (OpcodeType)0x1, - PushData = new[] { (byte)4 } - }, Op.GetPushOp(Encoders.ASCII.DecodeData(pszTimestamp)))); - txNew.Outputs.Add(genesisReward, genesisOutputScript); - Block genesis = Consensus.ConsensusFactory.CreateBlock(); - genesis.Header.BlockTime = Utils.UnixTimeToDateTime(nTime); - genesis.Header.Bits = nBits; - genesis.Header.Nonce = nNonce; - genesis.Header.Version = nVersion; - genesis.Transactions.Add(txNew); - genesis.Header.HashPrevBlock = uint256.Zero; - genesis.UpdateMerkleRoot(); - return genesis; - } private static void assert(bool v) { @@ -2663,16 +2636,6 @@ private IBase58Data CreateBase58Data(Base58Type type, string base58) throw new NotSupportedException("Invalid Base58Data type : " + type.ToString()); } - //private BitcoinWitScriptAddress CreateWitScriptAddress(string base58) - //{ - // return new BitcoinWitScriptAddress(base58, this); - //} - - //private BitcoinWitPubKeyAddress CreateWitPubKeyAddress(string base58) - //{ - // return new BitcoinWitPubKeyAddress(base58, this); - //} - private BitcoinColoredAddress CreateColoredAddress(string base58) { return new BitcoinColoredAddress(base58, this); @@ -2811,11 +2774,6 @@ public BitcoinPubKeyAddress CreateBitcoinAddress(KeyId dest) return NetworkStringParser.CreateP2PKH(dest, this); } - private BitcoinScriptAddress CreateBitcoinScriptAddress(ScriptId scriptId) - { - return NetworkStringParser.CreateP2SH(scriptId, this); - } - public Message ParseMessage(byte[] bytes, uint? version = null) { BitcoinStream bstream = new BitcoinStream(bytes);