New config setting - extralowdifficulty to use for testing:

replaces shared.useVeryEasyProofOfWorkForTesting and automatically
applies to test-mode.
This commit is contained in:
Dmitri Bogomolov 2019-03-07 14:21:07 +02:00
parent 23ca9c8c6b
commit 4b72a433c6
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
2 changed files with 7 additions and 14 deletions

View File

@ -69,7 +69,6 @@ import helper_threading
def connectToStream(streamNumber):
state.streamsInWhichIAmParticipating.append(streamNumber)
selfInitiatedConnections[streamNumber] = {}
if isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections():
# Some XP and Vista systems can only have 10 outgoing connections
@ -184,16 +183,6 @@ def signal_handler(signum, frame):
' because the UI captures the signal.')
# This is a list of current connections (the thread pointers at least)
selfInitiatedConnections = {}
if shared.useVeryEasyProofOfWorkForTesting:
defaults.networkDefaultProofOfWorkNonceTrialsPerByte = int(
defaults.networkDefaultProofOfWorkNonceTrialsPerByte / 100)
defaults.networkDefaultPayloadLengthExtraBytes = int(
defaults.networkDefaultPayloadLengthExtraBytes / 100)
class Main:
def start(self):
_fixSocket()
@ -274,6 +263,13 @@ class Main:
'bitmessagesettings', 'sendoutgoingconnections'):
state.dandelion = 0
if state.testmode or BMConfigParser().safeGetBoolean(
'bitmessagesettings', 'extralowdifficulty'):
defaults.networkDefaultProofOfWorkNonceTrialsPerByte = int(
defaults.networkDefaultProofOfWorkNonceTrialsPerByte / 100)
defaults.networkDefaultPayloadLengthExtraBytes = int(
defaults.networkDefaultPayloadLengthExtraBytes / 100)
knownnodes.readKnownNodes()
# Not needed if objproc is disabled

View File

@ -30,9 +30,6 @@ maximumAgeOfAnObjectThatIAmWillingToAccept = 216000
# from obtaining a needed pubkey for a period of time.
lengthOfTimeToHoldOnToAllPubkeys = 2419200
maximumAgeOfNodesThatIAdvertiseToOthers = 10800 # Equals three hours
# If you set this to True while on the normal network,
# you won't be able to send or sometimes receive messages.
useVeryEasyProofOfWorkForTesting = False
myECCryptorObjects = {}