X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=transports%2Fnative.py;h=2cc43131e42a9a81199c8d4a5debf74e0497a90e;hb=549ff3f84b6ea240285659e29ed613aa9a2182d7;hp=6eddf4bdc491fd4d1e70ae4306aa307b2dfef903;hpb=fe46b9196fd5b039848bbe11d49f47d4701045eb;p=electrum-server.git diff --git a/transports/native.py b/transports/native.py index 6eddf4b..2cc4313 100644 --- a/transports/native.py +++ b/transports/native.py @@ -1,13 +1,17 @@ import thread, threading, time, socket, traceback, ast, sys +from processor import timestr, random_string -def random_string(N): - import random, string - return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(N)) -def timestr(): - return time.strftime("[%d/%m/%Y-%H:%M:%S]") + +def new_to_old(s): + s = s.replace("'block_hash'", "'blk_hash'") + s = s.replace("'index'", "'pos'") + s = s.replace("'timestamp'", "'nTime'") + s = s.replace("'is_input'", "'is_in'") + s = s.replace("'raw_output_script'","'raw_scriptPubKey'") + return s class NativeServer(threading.Thread): @@ -156,6 +160,7 @@ class NativeServer(threading.Thread): elif cmd == 'h': address = data out = repr( self.store.get_history( address ) ) + out = new_to_old(out) elif cmd =='tx': out = self.store.send_tx(data)