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 58b6bd9 + 3af3ab6 commit 1e52581
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion ob-watcher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import BaseHTTPServer, SimpleHTTPServer, threading
from decimal import Decimal
import urllib2
Expand Down
15 changes: 11 additions & 4 deletions yield-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,30 @@
#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)
self.msgchan.register_channel_callbacks(self.on_welcome, self.on_set_topic,
None, None, self.on_nick_leave, None)
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 1e52581

Please sign in to comment.