Skip to content

Commit

Permalink
New config setting - extralowdifficulty to use for testing:
Browse files Browse the repository at this point in the history
replaces shared.useVeryEasyProofOfWorkForTesting and automatically
applies to test-mode.
  • Loading branch information
g1itch committed Apr 22, 2019
1 parent 23ca9c8 commit 4b72a43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
18 changes: 7 additions & 11 deletions src/bitmessagemain.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@

def connectToStream(streamNumber):
state.streamsInWhichIAmParticipating.append(streamNumber)
selfInitiatedConnections[streamNumber] = {}

if isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections():
# Some XP and Vista systems can only have 10 outgoing connections
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -274,6 +263,13 @@ def start(self):
'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
Expand Down
3 changes: 0 additions & 3 deletions src/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
# 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 = {}
Expand Down

0 comments on commit 4b72a43

Please sign in to comment.