Skip to content

Commit

Permalink
Merge pull request #37 from ryo-currency/topic-1.4.1
Browse files Browse the repository at this point in the history
Topic 1.4.1
  • Loading branch information
mosu-forge authored Apr 2, 2020
2 parents 4e0534f + 06941ce commit 33d15f8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ryo-wallet-atom",
"version": "1.4.0",
"daemonVersion": "0.5.0.1",
"version": "1.4.1",
"daemonVersion": "0.5.0.2",
"description": "Modern GUI interface for Ryo Currency",
"productName": "Ryo Wallet Atom",
"cordovaId": "com.ryo-currency.ryo-gui-wallet",
Expand Down
2 changes: 1 addition & 1 deletion quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module.exports = function (ctx) {

appId: "com.ryo-currency.wallet",
productName: "Ryo Wallet Atom",
copyright: "Copyright © 2019 Ryo Currency Project",
copyright: "Copyright © 2020 Ryo Currency Project",

// directories: {
// buildResources: "src-electron/build"
Expand Down
1 change: 1 addition & 0 deletions src-electron/main-process/modules/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class Daemon {
"--limit-rate-up", options.daemon.limit_rate_up,
"--limit-rate-down", options.daemon.limit_rate_down,
"--log-level", options.daemon.log_level,
"--log-file-level", options.daemon.log_level,
];

if(options.daemon.enhanced_ip_privacy) {
Expand Down
3 changes: 2 additions & 1 deletion src-electron/main-process/modules/pool/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Database {

hashrate_avg: this.db.prepare("SELECT * FROM hashrateAvg"),
hashrate_avg_add: this.db.prepare("INSERT OR IGNORE INTO hashrateAvg(miner, time, hashes) VALUES(:miner, :time, :hashes)"),
hashrate_avg_clean: this.db.prepare("DELETE FROM hashrate WHERE time < :time"),
hashrate_avg_clean: this.db.prepare("DELETE FROM hashrateAvg WHERE time < :time"),
}


Expand Down Expand Up @@ -86,6 +86,7 @@ export class Database {
}

init() {
this.db.pragma("journal_mode = WAL");
this.db.prepare("CREATE TABLE IF NOT EXISTS round(miner TEXT PRIMARY KEY, hashes INTEGER) WITHOUT ROWID;").run()
this.db.prepare("CREATE TABLE IF NOT EXISTS hashrate(miner TEXT, time DATETIME, hashes INTEGER);").run()
this.db.prepare("CREATE TABLE IF NOT EXISTS hashrateAvg(miner TEXT, time DATETIME, hashes INTEGER);").run()
Expand Down
17 changes: 13 additions & 4 deletions src-electron/main-process/modules/wallet-rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export class WalletRPC {

this.last_height_send_time = Date.now()

this.height_regex = /Pulled blocks (\d+)-(\d+) \/ (\d+)/
this.height_regex_1 = /Pulled blocks (\d+)-(\d+) \/ (\d+)/
this.height_regex_2 = /On new block (\d+) - (\w)/

this.agent = new http.Agent({keepAlive: true, maxSockets: 1})
this.queue = new queue(1, Infinity)
Expand Down Expand Up @@ -62,6 +63,7 @@ export class WalletRPC {
"--rpc-login", this.auth[0]+":"+this.auth[1],
"--rpc-bind-port", options.wallet.rpc_bind_port,
"--daemon-address", daemon_address,
"--log-file-level", options.wallet.log_level,
"--log-level", "3",
// "--log-level", "*:WARNING,net*:FATAL,net.http:DEBUG,global:INFO,verify:FATAL,stacktrace:INFO",
]
Expand Down Expand Up @@ -107,12 +109,19 @@ export class WalletRPC {
let lines = data.toString().split("\n");
let match, height = null
lines.forEach((line) => {
match = line.match(this.height_regex)
match = line.match(this.height_regex_1)
if (match) {
height = match[2]
return
}
match = line.match(this.height_regex_2)
if (match) {
height = match[1]
return
}
})
if(height && Date.now() - this.last_height_send_time > 1000) {

if(height && height > this.wallet_info.height && Date.now() - this.last_height_send_time > 1000) {
this.last_height_send_time = Date.now()
this.sendGateway("set_wallet_data", {
info: {
Expand Down Expand Up @@ -1316,7 +1325,7 @@ export class WalletRPC {
this.agent.destroy()
resolve()
})
this.walletRPCProcess.kill(3)
this.walletRPCProcess.kill('SIGKILL')
}, 10000)
} else {
resolve()
Expand Down

0 comments on commit 33d15f8

Please sign in to comment.