Browse Source

Merge #555: Remove jm_single config var call from jmdaemon

6d87322 Remove jm_single config var call from jmdaemon (Adam Gibson)
master
Adam Gibson 6 years ago
parent
commit
0b65bc3101
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 20
      jmdaemon/jmdaemon/daemon_protocol.py
  2. 7
      jmdaemon/jmdaemon/message_channel.py

20
jmdaemon/jmdaemon/daemon_protocol.py

@ -415,22 +415,12 @@ class JMDaemonServerProtocol(amp.AMP, OrderbookWatch):
@maker_only
def on_commitment_seen(self, nick, commitment):
"""Triggered when we see a commitment for blacklisting
appear in the public pit channel. If the policy is set,
we blacklist this commitment.
appear in the public pit channel.
"""
if jm_single().config.has_option("POLICY", "accept_commitment_broadcasts"):
blacklist_add = jm_single().config.getint("POLICY",
"accept_commitment_broadcasts")
else:
blacklist_add = 0
if blacklist_add > 0:
#just add if necessary, ignore return value.
check_utxo_blacklist(commitment, persist=True)
log.msg("Received commitment broadcast by other maker: " + str(
commitment) + ", now blacklisted.")
else:
log.msg("Received commitment broadcast by other maker: " + str(
commitment) + ", ignored.")
#just add if necessary, ignore return value.
check_utxo_blacklist(commitment, persist=True)
log.msg("Received commitment broadcast by other maker: " + str(
commitment) + ", now blacklisted.")
@maker_only
def on_commitment_transferred(self, nick, commitment):

7
jmdaemon/jmdaemon/message_channel.py

@ -805,10 +805,11 @@ class MessageChannel(object):
else:
if self.on_commitment_seen:
self.on_commitment_seen(counterparty, commitment)
except IndexError as e:
except Exception as e:
log.debug(e)
log.debug('index error parsing chunks, possibly malformed'
'offer by other party. No user action required.')
log.debug('Error parsing chunks, possibly malformed'
'commitment by other party. No user action required.')
log.debug("the chunks were: " + str(_chunks))
finally:
return True
return False

Loading…
Cancel
Save