litecoin-project / litecoin

Litecoin source tree
http://www.litecoin.org
MIT License
4.38k stars 3.03k forks source link

Help: How to modify the pchMessageStart parameter based on the timestamp, since the coin I'm developing uses the same network magic number as LTC. #976

Closed msy2008 closed 1 week ago

msy2008 commented 3 months ago

image

image image

The original developer of Ininitecoin used the same network magic number as Litecoin, which caused node mixing and cross-connection. I am trying to find a solution. I can activate the new network magic number based on the timestamp, but I need to restart the core wallet to take effect. How can I achieve the goal without restarting? Please help! Thanks

msy2008 commented 3 months ago

For example:

if (time(NULL) >= 1725868500) { // GMT: Monday, September 9, 2024, 7:55 AM // new message header (New consensus network magic number) pchMessageStart[0] = 0xfa; pchMessageStart[1] = 0xbe; pchMessageStart[2] = 0xc0; pchMessageStart[3] = 0xde; } else { // old message header (IFC and LTC network magic number are the same, resulting in mixed node connections) pchMessageStart[0] = 0xfb; pchMessageStart[1] = 0xc0; pchMessageStart[2] = 0xb6; pchMessageStart[3] = 0xdb; }

msy2008 commented 3 months ago

If I don't change the network magic number, the LTC nodes will be affected as more and more users come in the future. I hope LTC developers can help me.

losh11 commented 3 months ago

Hi, changing the magic number requires you to hardfork. Old and newer clients would not be able to communicate with each other unless you add some logic to the newer client to accept the older magic number too. I can’t really help any further.

On Mon, 19 Aug 2024 at 15:38, msy2008 @.***> wrote:

If I don't change the network magic number, the LTC nodes will be affected as more and more users come in the future. I hope LTC developers can help me.

— Reply to this email directly, view it on GitHub https://github.com/litecoin-project/litecoin/issues/976#issuecomment-2296602540, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT43OS57QALGT7KTT6GIKLZSHYONAVCNFSM6AAAAABMXJWF2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJWGYYDENJUGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

msy2008 commented 3 months ago

I can activate the new network magic number based on the timestamp, but I need to restart the core wallet to take effect. How can I achieve the goal without restarting?

msy2008 commented 3 months ago

According to the timestamp, the old and new versions can communicate before activation, and the new version does not need to communicate with the old version after activation. I will give at least 2 weeks for all nodes, mining pools, exchanges, and Explorers to update to the new version, but I cannot automatically switch to the new network magic number without restarting the wallet.

losh11 commented 1 week ago

We unfortunately cannot help with altcoin related discussion here.