Skip to content

Commit

Permalink
Merge pull request JoinMarket-Org#125 from haarts/master
Browse files Browse the repository at this point in the history
Prevents startup spam to log.
  • Loading branch information
chris-belcher committed Jul 6, 2015
2 parents 4b0b3aa + 74b933e commit 7e6f037
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions yield-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#spent from utxos that try to make the highest balance even higher
# so try to keep coins concentrated in one mixing depth
class YieldGenerator(Maker):
statement_file = os.path.join('logs', 'yigen-statement.csv')

def __init__(self, msgchan, wallet):
Maker.__init__(self, msgchan, wallet)
Expand All @@ -39,17 +40,22 @@ def __init__(self, msgchan, wallet):
self.tx_unconfirm_timestamp = {}

def log_statement(self, data):
if common.get_network() == 'testnet':
return

data = [str(d) for d in data]
self.income_statement = open(os.path.join('logs',
'yigen-statement.csv'), 'aw')
self.income_statement = open(statement_file, 'a')
self.income_statement.write(','.join(data) + '\n')
self.income_statement.close()

def on_welcome(self):
Maker.on_welcome(self)
self.log_statement(['timestamp', 'cj amount/satoshi', 'my input count',
'my input value/satoshi', 'cjfee/satoshi',
'earned/satoshi', 'confirm time/min', 'notes'])
if not os.path.isfile(statement_file):
self.log_statement(
['timestamp', 'cj amount/satoshi', 'my input count',
'my input value/satoshi', 'cjfee/satoshi', 'earned/satoshi',
'confirm time/min', 'notes'])

timestamp = datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S")
self.log_statement([timestamp, '', '', '', '', '', '', 'Connected'])

Expand Down

0 comments on commit 7e6f037

Please sign in to comment.