Skip to content

Commit

Permalink
Merge pull request #72 from pknight007/tor
Browse files Browse the repository at this point in the history
 merge master into tor branch (incl. CORS fix)
  • Loading branch information
metalicjames authored Jan 7, 2018
2 parents 36a650e + 896b04c commit e4aeb2f
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 34 deletions.
7 changes: 0 additions & 7 deletions contrib/build-wine/build-electrum-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,4 @@ cd dist
mv electrum-vtc-setup.exe $NAME_ROOT-$VERSION-setup.exe
cd ..

# build portable version
cp portable.patch $WINEPREFIX/drive_c/electrum-vtc
pushd $WINEPREFIX/drive_c/electrum-vtc
patch < portable.patch
popd
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec

echo "Done."
1 change: 1 addition & 0 deletions contrib/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ a = Analysis([home+'electrum-vtc',
home+'lib/blockchain.py',
home+'lib/dnssec.py',
home+'lib/commands.py',
home+'lib/network.py',
home+'plugins/cosigner_pool/qt.py',
home+'plugins/email_requests/qt.py',
home+'plugins/trezor/client.py',
Expand Down
8 changes: 4 additions & 4 deletions gui/kivy/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def on_history(self, d):
self._trigger_update_history()

def _get_bu(self):
return self.electrum_config.get('base_unit', 'LTC')
return self.electrum_config.get('base_unit', 'VTC')

def _set_bu(self, value):
assert value in base_units.keys()
Expand Down Expand Up @@ -241,7 +241,7 @@ def __init__(self, **kwargs):

super(ElectrumWindow, self).__init__(**kwargs)

title = _('Electrum-LTC App')
title = _('Electrum-VTC App')
self.electrum_config = config = kwargs.get('config', None)
self.language = config.get('language', 'en')

Expand Down Expand Up @@ -676,8 +676,8 @@ def notify(self, message):
from plyer import notification
icon = (os.path.dirname(os.path.realpath(__file__))
+ '/../../' + self.icon)
notification.notify('Electrum-LTC', message,
app_icon=icon, app_name='Electrum-LTC')
notification.notify('Electrum-VTC', message,
app_icon=icon, app_name='Electrum-VTC')
except ImportError:
Logger.Error('Notification: needs plyer; `sudo pip install plyer`')

Expand Down
2 changes: 1 addition & 1 deletion gui/kivy/tools/buildozer.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app]

# (str) Title of your application
title = Electrum-LTC
title = Electrum-VTC

# (str) Package name
package.name = Electrum_VTC
Expand Down
2 changes: 1 addition & 1 deletion gui/kivy/uix/ui_screens/about.kv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#:import VERSION electrum_vtc.version.ELECTRUM_VERSION

Popup:
title: _("About Electrum-LTC")
title: _("About Electrum-VTC")
BoxLayout:
orientation: 'vertical'
spacing: '10dp'
Expand Down
2 changes: 1 addition & 1 deletion gui/kivy/uix/ui_screens/status.kv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Popup:
title: "Electrum-LTC"
title: "Electrum-VTC"
confirmed: 0
unconfirmed: 0
unmatured: 0
Expand Down
6 changes: 6 additions & 0 deletions lib/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ def get_target(self, height, chain={}):
return 0, 0
if height == 0 or height == 208301:
return 0x1e0ffff0, 0x00000FFFF0000000000000000000000000000000000000000000000000000000
if height == 468741:
bits = 469820683
bitsBase = bits & 0xffffff
bitsN = (bits >> 24) & 0xff
target = bitsBase << (8 * (bitsN - 3))
return bits, target
if height < 26754:
# Litecoin: go back the full period unless it's the first retarget
first = self.read_header((height - 2016 - 1 if height > 2016 else 0))
Expand Down
4 changes: 2 additions & 2 deletions lib/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def _format_request(self, out):
PR_PAID: 'Paid',
PR_EXPIRED: 'Expired',
}
out['amount (LTC)'] = format_satoshis(out.get('amount'))
out['amount (VTC)'] = format_satoshis(out.get('amount'))
out['status'] = pr_str[out.get('status', PR_UNKNOWN)]
return out

Expand Down Expand Up @@ -705,7 +705,7 @@ def help(self):
'show_labels': ("-l", "--labels", "Show the labels of listed addresses"),
'nocheck': (None, "--nocheck", "Do not verify aliases"),
'imax': (None, "--imax", "Maximum number of inputs"),
'tx_fee': ("-f", "--fee", "Transaction fee (in LTC)"),
'tx_fee': ("-f", "--fee", "Transaction fee (in VTC)"),
'from_addr': ("-F", "--from", "Source address. If it isn't in the wallet, it will ask for the private key unless supplied in the format public_key:private_key. It's not saved in the wallet."),
'change_addr': ("-c", "--change", "Change address. Default is a spare address, or the source address if it's not in the wallet"),
'nbits': (None, "--nbits", "Number of bits of entropy"),
Expand Down
18 changes: 2 additions & 16 deletions lib/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import time

import jsonrpclib
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer, SimpleJSONRPCRequestHandler
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer

from version import ELECTRUM_VERSION
from network import Network
Expand Down Expand Up @@ -86,19 +86,6 @@ def get_server(config):



class RequestHandler(SimpleJSONRPCRequestHandler):

def do_OPTIONS(self):
self.send_response(200)
self.end_headers()

def end_headers(self):
self.send_header("Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept")
self.send_header("Access-Control-Allow-Origin", "*")
SimpleJSONRPCRequestHandler.end_headers(self)


class Daemon(DaemonThread):

def __init__(self, config, fd):
Expand All @@ -123,8 +110,7 @@ def init_server(self, config, fd):
host = config.get('rpchost', '127.0.0.1')
port = config.get('rpcport', 0)
try:
server = SimpleJSONRPCServer((host, port), logRequests=False,
requestHandler=RequestHandler)
server = SimpleJSONRPCServer((host, port), logRequests=False)
except:
self.print_error('Warning: cannot initialize RPC server on host', host)
self.server = None
Expand Down
2 changes: 1 addition & 1 deletion lib/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ELECTRUM_VERSION = '2.9.3.3-tor' # version of the client package
ELECTRUM_VERSION = '2.9.3.5-tor' # version of the client package
PROTOCOL_VERSION = '0.10' # protocol version requested

# The hash of the mnemonic seed must begin with this
Expand Down
2 changes: 1 addition & 1 deletion lib/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.done( function(data) {
new QRCode(document.getElementById("qrcode"), data.URI);
$("<p />").text(data.memo).appendTo($("p#reason"));
$("<p />").text(data.amount/100000000 + "LTC").appendTo($("p#amount"));
$("<p />").text(data.amount/100000000 + "VTC").appendTo($("p#amount"));
$("a").attr("href", data.URI);
$("<p />").text("Powered by Electrum").appendTo($("p#powered"));
var websocket_server = data.websocket_server;
Expand Down

0 comments on commit e4aeb2f

Please sign in to comment.