electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 4f6ac1d613ebb5d11f5f2e349d3f3e69feac5808
parent 6e26fb0198f9ddddfe993ea47526445f60951601
Author: ThomasV <thomasv1@gmx.de>
Date:   Fri, 28 Mar 2014 17:19:48 +0100

Merge pull request #631 from jisqyv/jischanges

Updates for merchant.py
Diffstat:
Mscripts/merchant/merchant.py | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/merchant/merchant.py b/scripts/merchant/merchant.py @@ -167,7 +167,7 @@ if __name__ == '__main__': wallet = Wallet(storage) if not storage.file_exists: wallet.seed = '' - wallet.create_watching_only_wallet(master_chain,master_public_key) + wallet.create_watching_only_wallet(master_public_key,master_chain) wallet.synchronize = lambda: None # prevent address creation by the wallet wallet.start_threads(network) @@ -218,10 +218,10 @@ if __name__ == '__main__': cur.execute("""UPDATE electrum_payments set paid=0 WHERE expires_at < CURRENT_TIMESTAMP and paid is NULL;""") # do callback for addresses that received payment or expired - cur.execute("""SELECT address, paid from electrum_payments WHERE paid is not NULL and processed is NULL;""") + cur.execute("""SELECT oid, address, paid from electrum_payments WHERE paid is not NULL and processed is NULL;""") data = cur.fetchall() for item in data: - address, paid = item + oid, address, paid = item paid = bool(paid) headers = {'content-type':'application/json'} data_json = { 'address':address, 'password':cb_password, 'paid':paid } @@ -230,7 +230,8 @@ if __name__ == '__main__': req = urllib2.Request(url, data_json, headers) try: response_stream = urllib2.urlopen(req) - cur.execute("UPDATE electrum_payments SET processed=1 WHERE id=%d;"%(id)) + print 'Got Response for %s' % address + cur.execute("UPDATE electrum_payments SET processed=1 WHERE oid=%d;"%(oid)) except urllib2.HTTPError: print "cannot do callback", data_json except ValueError, e: