Neptune-Crypto / neptune-core

anonymous peer-to-peer cash
Apache License 2.0
24 stars 7 forks source link

"regtest" hard-coded in log output #57

Closed dan-da closed 10 months ago

dan-da commented 11 months ago

I've been seeing lines like this in output of neptune-core:

2023-10-05T21:56:38.383155149Z  INFO ThreadId(05) neptune_core::peer_loop: Updated block info by block from peer. block height 600
2023-10-05T21:56:39.474829162Z  INFO ThreadId(05) neptune_core::mine_loop: Mining thread got message from main
2023-10-05T21:56:39.474974901Z  INFO ThreadId(05) neptune_core::mine_loop: Miner thread received regtest block height 600

neptune-core is started with the command:

RUST_BACKTRACE=1 RUST_LOG='info,tarpc=warn' cargo run --bin neptune-core -- --mine --throttled-mining --peers 51.15.139.238:9798 --peers 139.162.193.206:9798

Given that there are peers, I would not think that regtest should not be used. So I grepped in the code and found:

$ rg regtest mine_loop.rs 
361:                        info!("Miner thread received regtest block height {}", latest_block.header.height);
405:                info!("Found new regtest block with block height {}. Hash: {}", new_block_info.block.header.height, new_block_info.block.hash.emojihash());

I think that either regtest should be removed from these, or replaced with a string variable identifying the current network.

I plan to submit a PR for this soon.