1
0
Fork 0
forked from lthn/blockchain

Merge branch 'master' into testnet2

This commit is contained in:
crypro.zoidberg 2019-03-03 18:11:32 +01:00
commit 1173d669b0
23 changed files with 513 additions and 242 deletions

View file

@ -145,9 +145,10 @@ namespace currency
//check key images for transaction if it is not kept by block
if(!from_core && !kept_by_block)
{
if(have_tx_keyimges_as_spent(tx))
crypto::key_image spent_ki = AUTO_VAL_INIT(spent_ki);
if(have_tx_keyimges_as_spent(tx, &spent_ki))
{
LOG_ERROR("Transaction with id= "<< id << " used already spent key images");
LOG_ERROR("Transaction " << id << " uses already spent key image " << spent_ki);
tvc.m_verification_failed = true;
return false;
}
@ -735,15 +736,19 @@ namespace currency
return false;
}
//---------------------------------------------------------------------------------
bool tx_memory_pool::have_tx_keyimges_as_spent(const transaction& tx) const
bool tx_memory_pool::have_tx_keyimges_as_spent(const transaction& tx, crypto::key_image* p_spent_ki /* = nullptr */) const
{
for(const auto& in : tx.vin)
{
if (in.type() == typeid(txin_to_key))
{
CHECKED_GET_SPECIFIC_VARIANT(in, const txin_to_key, tokey_in, true);//should never fail
if(have_tx_keyimg_as_spent(tokey_in.k_image))
return true;
if (have_tx_keyimg_as_spent(tokey_in.k_image))
{
if (p_spent_ki)
*p_spent_ki = tokey_in.k_image;
return true;
}
}
}
@ -761,8 +766,10 @@ namespace currency
auto ki_entry_ptr = m_db_key_images_set.get(tokey_in.k_image);
if (ki_entry_ptr.get())
count = *ki_entry_ptr;
uint64_t count_before = count;
++count;
m_db_key_images_set.set(tokey_in.k_image, count);
LOG_PRINT_L2("tx pool: key image added: " << tokey_in.k_image << ", from tx " << get_transaction_hash(tx) << ", counter: " << count_before << " -> " << count);
}
}
return false;
@ -828,11 +835,13 @@ namespace currency
continue;
}
count = *ki_entry_ptr;
uint64_t count_before = count;
--count;
if (count)
m_db_key_images_set.set(tokey_in.k_image, count);
else
m_db_key_images_set.erase(tokey_in.k_image);
LOG_PRINT_L2("tx pool: key image removed: " << tokey_in.k_image << ", from tx " << get_transaction_hash(tx) << ", counter: " << count_before << " -> " << count);
}
}
return false;

View file

@ -92,7 +92,7 @@ namespace currency
bool have_tx(const crypto::hash &id)const;
bool have_tx_keyimg_as_spent(const crypto::key_image& key_im)const;
bool have_tx_keyimges_as_spent(const transaction& tx)const;
bool have_tx_keyimges_as_spent(const transaction& tx, crypto::key_image* p_spent_ki = nullptr) const;
const performnce_data& get_performnce_data() const { return m_performance_data; }

View file

@ -1596,8 +1596,8 @@ std::string daemon_backend::get_wallet_log_prefix(size_t wallet_id) const
CRITICAL_REGION_LOCAL(m_wallets_lock);
auto it = m_wallets.find(wallet_id);
if (it == m_wallets.end())
return std::string("[W:???id=") + epee::string_tools::num_to_string_fast(wallet_id) + "]";
return std::string("[") + epee::string_tools::num_to_string_fast(wallet_id) + ":???]";
return std::string("[W:") + it->second.w->get()->get_account().get_public_address_str().substr(0, 6) + "]";
return std::string("[") + epee::string_tools::num_to_string_fast(wallet_id) + ":" + it->second.w->get()->get_account().get_public_address_str().substr(0, 6) + "]";
}

View file

@ -571,7 +571,7 @@ bool MainWindow::update_wallet_status(const view::wallet_status_info& wsi)
m_wallet_states->operator [](wsi.wallet_id) = wsi.wallet_state;
std::string json_str;
epee::serialization::store_t_to_json(wsi, json_str);
LOG_PRINT_L0("SENDING SIGNAL -> [update_wallet_status]:" << std::endl << json_str );
LOG_PRINT_L0(get_wallet_log_prefix(wsi.wallet_id) + "SENDING SIGNAL -> [update_wallet_status]:" << std::endl << json_str );
QMetaObject::invokeMethod(this, "update_wallet_status", Qt::QueuedConnection, Q_ARG(QString, json_str.c_str()));
return true;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -649,7 +649,7 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
/*! no static exports found */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.1' };
var core = module.exports = { version: '2.6.2' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
@ -1807,7 +1807,7 @@ var store = global[SHARED] || (global[SHARED] = {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global',
copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
@ -2364,7 +2364,6 @@ $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
* found in the LICENSE file at https://angular.io/license
*/
var Zone$1 = (function (global) {
var FUNCTION = 'function';
var performance = global['performance'];
function mark(name) {
performance && performance['mark'] && performance['mark'](name);
@ -2373,12 +2372,26 @@ var Zone$1 = (function (global) {
performance && performance['measure'] && performance['measure'](name, label);
}
mark('Zone');
var checkDuplicate = global[('__zone_symbol__forceDuplicateZoneCheck')] === true;
if (global['Zone']) {
throw new Error('Zone already loaded.');
// if global['Zone'] already exists (maybe zone.js was already loaded or
// some other lib also registered a global object named Zone), we may need
// to throw an error, but sometimes user may not want this error.
// For example,
// we have two web pages, page1 includes zone.js, page2 doesn't.
// and the 1st time user load page1 and page2, everything work fine,
// but when user load page2 again, error occurs because global['Zone'] already exists.
// so we add a flag to let user choose whether to throw this error or not.
// By default, if existing Zone is from zone.js, we will not throw the error.
if (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function') {
throw new Error('Zone already loaded.');
}
else {
return global['Zone'];
}
}
var Zone = /** @class */ (function () {
function Zone(parent, zoneSpec) {
this._properties = null;
this._parent = parent;
this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>';
this._properties = zoneSpec && zoneSpec.properties || {};
@ -2421,7 +2434,9 @@ var Zone$1 = (function (global) {
});
Zone.__load_patch = function (name, fn) {
if (patches.hasOwnProperty(name)) {
throw Error('Already loaded patch: ' + name);
if (checkDuplicate) {
throw Error('Already loaded patch: ' + name);
}
}
else if (!global['__Zone_disable_' + name]) {
var perfName = 'Zone:' + name;
@ -2465,7 +2480,7 @@ var Zone$1 = (function (global) {
return this._zoneDelegate.fork(this, zoneSpec);
};
Zone.prototype.wrap = function (callback, source) {
if (typeof callback !== FUNCTION) {
if (typeof callback !== 'function') {
throw new Error('Expecting function got: ' + callback);
}
var _callback = this._zoneDelegate.intercept(this, callback, source);
@ -2475,9 +2490,6 @@ var Zone$1 = (function (global) {
};
};
Zone.prototype.run = function (callback, applyThis, applyArgs, source) {
if (applyThis === void 0) { applyThis = undefined; }
if (applyArgs === void 0) { applyArgs = null; }
if (source === void 0) { source = null; }
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
try {
return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);
@ -2488,8 +2500,6 @@ var Zone$1 = (function (global) {
};
Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) {
if (applyThis === void 0) { applyThis = null; }
if (applyArgs === void 0) { applyArgs = null; }
if (source === void 0) { source = null; }
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
try {
try {
@ -2513,10 +2523,7 @@ var Zone$1 = (function (global) {
// https://github.com/angular/zone.js/issues/778, sometimes eventTask
// will run in notScheduled(canceled) state, we should not try to
// run such kind of task but just return
// we have to define an variable here, if not
// typescript compiler will complain below
var isNotScheduled = task.state === notScheduled;
if (isNotScheduled && task.type === eventTask) {
if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) {
return;
}
var reEntryGuard = task.state != running;
@ -2527,7 +2534,7 @@ var Zone$1 = (function (global) {
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
try {
if (task.type == macroTask && task.data && !task.data.isPeriodic) {
task.cancelFn = null;
task.cancelFn = undefined;
}
try {
return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);
@ -2563,8 +2570,7 @@ var Zone$1 = (function (global) {
var newZone = this;
while (newZone) {
if (newZone === task.zone) {
throw Error("can not reschedule task to " + this
.name + " which is descendants of the original zone " + task.zone.name);
throw Error("can not reschedule task to " + this.name + " which is descendants of the original zone " + task.zone.name);
}
newZone = newZone.parent;
}
@ -2594,7 +2600,7 @@ var Zone$1 = (function (global) {
return task;
};
Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) {
return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, null));
return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));
};
Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) {
return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));
@ -2635,16 +2641,14 @@ var Zone$1 = (function (global) {
}());
var DELEGATE_ZS = {
name: '',
onHasTask: function (delegate, _, target, hasTaskState) {
return delegate.hasTask(target, hasTaskState);
},
onHasTask: function (delegate, _, target, hasTaskState) { return delegate.hasTask(target, hasTaskState); },
onScheduleTask: function (delegate, _, target, task) {
return delegate.scheduleTask(target, task);
},
onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) { return delegate.invokeTask(target, task, applyThis, applyArgs); },
onCancelTask: function (delegate, _, target, task) {
return delegate.cancelTask(target, task);
}
onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) {
return delegate.invokeTask(target, task, applyThis, applyArgs);
},
onCancelTask: function (delegate, _, target, task) { return delegate.cancelTask(target, task); }
};
var ZoneDelegate = /** @class */ (function () {
function ZoneDelegate(zone, parentDelegate, zoneSpec) {
@ -2672,8 +2676,8 @@ var Zone$1 = (function (global) {
zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate.zone);
this._scheduleTaskZS =
zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);
this._scheduleTaskDlgt =
zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);
this._scheduleTaskDlgt = zoneSpec &&
(zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);
this._scheduleTaskCurrZone =
zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate.zone);
this._invokeTaskZS =
@ -2728,8 +2732,7 @@ var Zone$1 = (function (global) {
callback;
};
ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) {
return this._invokeZS ?
this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :
return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :
callback.apply(applyThis, applyArgs);
};
ZoneDelegate.prototype.handleError = function (targetZone, error) {
@ -2761,8 +2764,7 @@ var Zone$1 = (function (global) {
return returnTask;
};
ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {
return this._invokeTaskZS ?
this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :
return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :
task.callback.apply(applyThis, applyArgs);
};
ZoneDelegate.prototype.cancelTask = function (targetZone, task) {
@ -2782,7 +2784,7 @@ var Zone$1 = (function (global) {
// hasTask should not throw error so other ZoneDelegate
// can still trigger hasTask callback
try {
return this._hasTaskZS &&
this._hasTaskZS &&
this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);
}
catch (err) {
@ -2872,14 +2874,12 @@ var Zone$1 = (function (global) {
}
}
else {
throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ?
' or \'' + fromState2 + '\'' :
'') + ", was '" + this._state + "'.");
throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ? ' or \'' + fromState2 + '\'' : '') + ", was '" + this._state + "'.");
}
};
ZoneTask.prototype.toString = function () {
if (this.data && typeof this.data.handleId !== 'undefined') {
return this.data.handleId;
return this.data.handleId.toString();
}
else {
return Object.prototype.toString.call(this);
@ -2920,7 +2920,13 @@ var Zone$1 = (function (global) {
}
}
if (nativeMicroTaskQueuePromise) {
nativeMicroTaskQueuePromise[symbolThen](drainMicroTaskQueue);
var nativeThen = nativeMicroTaskQueuePromise[symbolThen];
if (!nativeThen) {
// native Promise is not patchable, we need to use `then` directly
// issue 1078
nativeThen = nativeMicroTaskQueuePromise['then'];
}
nativeThen.call(nativeMicroTaskQueuePromise, drainMicroTaskQueue);
}
else {
global[symbolSetTimeout](drainMicroTaskQueue, 0);
@ -2967,12 +2973,13 @@ var Zone$1 = (function (global) {
patchEventTarget: function () { return []; },
patchOnProperties: noop,
patchMethod: function () { return noop; },
bindArguments: function () { return null; },
bindArguments: function () { return []; },
patchThen: function () { return noop; },
setNativePromise: function (NativePromise) {
// sometimes NativePromise.resolve static function
// is not ready yet, (such as core-js/es6.promise)
// so we need to check here.
if (NativePromise && typeof NativePromise.resolve === FUNCTION) {
if (NativePromise && typeof NativePromise.resolve === 'function') {
nativeMicroTaskQueuePromise = NativePromise.resolve(0);
}
},
@ -2988,6 +2995,16 @@ var Zone$1 = (function (global) {
return global['Zone'] = Zone;
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);
var __values = (undefined && undefined.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ObjectDefineProperty = Object.defineProperty;
@ -3130,7 +3147,7 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
var queue = promise[symbolValue];
promise[symbolValue] = value;
if (promise[symbolFinally] === symbolFinally) {
// the promise is generated by Promise.prototype.finally
// the promise is generated by Promise.prototype.finally
if (state === RESOLVED) {
// the state is resolved, should ignore the value
// and use parent promise value
@ -3214,7 +3231,9 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
chainPromise[symbolParentPromiseState] = promiseState;
}
// should not pass value to finally callback
var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]);
var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ?
[] :
[parentPromiseValue]);
resolvePromise(chainPromise, true, value);
}
catch (error) {
@ -3249,6 +3268,7 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
return resolvePromise(new this(null), REJECTED, error);
};
ZoneAwarePromise.race = function (values) {
var e_1, _a;
var resolve;
var reject;
var promise = new this(function (res, rej) {
@ -3261,40 +3281,70 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
function onReject(error) {
promise && (promise = false || reject(error));
}
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
var value = values_1[_i];
if (!isThenable(value)) {
value = this.resolve(value);
try {
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
var value = values_1_1.value;
if (!isThenable(value)) {
value = this.resolve(value);
}
value.then(onResolve, onReject);
}
value.then(onResolve, onReject);
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
}
finally { if (e_1) throw e_1.error; }
}
return promise;
};
ZoneAwarePromise.all = function (values) {
var e_2, _a;
var resolve;
var reject;
var promise = new this(function (res, rej) {
resolve = res;
reject = rej;
});
var count = 0;
// Start at 2 to prevent prematurely resolving if .then is called immediately.
var unresolvedCount = 2;
var valueIndex = 0;
var resolvedValues = [];
for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {
var value = values_2[_i];
var _loop_2 = function (value) {
if (!isThenable(value)) {
value = this.resolve(value);
value = this_1.resolve(value);
}
value.then((function (index) { return function (value) {
resolvedValues[index] = value;
count--;
if (!count) {
var curValueIndex = valueIndex;
value.then(function (value) {
resolvedValues[curValueIndex] = value;
unresolvedCount--;
if (unresolvedCount === 0) {
resolve(resolvedValues);
}
}; })(count), reject);
count++;
}, reject);
unresolvedCount++;
valueIndex++;
};
var this_1 = this;
try {
for (var values_2 = __values(values), values_2_1 = values_2.next(); !values_2_1.done; values_2_1 = values_2.next()) {
var value = values_2_1.value;
_loop_2(value);
}
}
if (!count)
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
}
finally { if (e_2) throw e_2.error; }
}
// Make the unresolvedCount zero-based again.
unresolvedCount -= 2;
if (unresolvedCount === 0) {
resolve(resolvedValues);
}
return promise;
};
ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {
@ -3390,31 +3440,112 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
};
Ctor[symbolThenPatched] = true;
}
function zoneify(fn) {
return function () {
var resultPromise = fn.apply(this, arguments);
if (resultPromise instanceof ZoneAwarePromise) {
return resultPromise;
}
var ctor = resultPromise.constructor;
if (!ctor[symbolThenPatched]) {
patchThen(ctor);
}
return resultPromise;
};
}
api.patchThen = patchThen;
if (NativePromise) {
patchThen(NativePromise);
var fetch_1 = global['fetch'];
if (typeof fetch_1 == 'function') {
global['fetch'] = zoneify(fetch_1);
}
}
// This is not part of public API, but it is useful for tests, so we expose it.
Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
return ZoneAwarePromise;
});
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
Zone.__load_patch('fetch', function (global, Zone, api) {
var fetch = global['fetch'];
var ZoneAwarePromise = global.Promise;
var symbolThenPatched = api.symbol('thenPatched');
var fetchTaskScheduling = api.symbol('fetchTaskScheduling');
var fetchTaskAborting = api.symbol('fetchTaskAborting');
if (typeof fetch !== 'function') {
return;
}
var OriginalAbortController = global['AbortController'];
var supportAbort = typeof OriginalAbortController === 'function';
var abortNative = null;
if (supportAbort) {
global['AbortController'] = function () {
var abortController = new OriginalAbortController();
var signal = abortController.signal;
signal.abortController = abortController;
return abortController;
};
abortNative = api.patchMethod(OriginalAbortController.prototype, 'abort', function (delegate) { return function (self, args) {
if (self.task) {
return self.task.zone.cancelTask(self.task);
}
return delegate.apply(self, args);
}; });
}
var placeholder = function () { };
global['fetch'] = function () {
var _this = this;
var args = Array.prototype.slice.call(arguments);
var options = args.length > 1 ? args[1] : null;
var signal = options && options.signal;
return new Promise(function (res, rej) {
var task = Zone.current.scheduleMacroTask('fetch', placeholder, args, function () {
var fetchPromise;
var zone = Zone.current;
try {
zone[fetchTaskScheduling] = true;
fetchPromise = fetch.apply(_this, args);
}
catch (error) {
rej(error);
return;
}
finally {
zone[fetchTaskScheduling] = false;
}
if (!(fetchPromise instanceof ZoneAwarePromise)) {
var ctor = fetchPromise.constructor;
if (!ctor[symbolThenPatched]) {
api.patchThen(ctor);
}
}
fetchPromise.then(function (resource) {
if (task.state !== 'notScheduled') {
task.invoke();
}
res(resource);
}, function (error) {
if (task.state !== 'notScheduled') {
task.invoke();
}
rej(error);
});
}, function () {
if (!supportAbort) {
rej('No AbortController supported, can not cancel fetch');
return;
}
if (signal && signal.abortController && !signal.aborted &&
typeof signal.abortController.abort === 'function' && abortNative) {
try {
Zone.current[fetchTaskAborting] = true;
abortNative.call(signal.abortController);
}
finally {
Zone.current[fetchTaskAborting] = false;
}
}
else {
rej('cancel fetch need a AbortController.signal');
}
});
if (signal && signal.abortController) {
signal.abortController.task = task;
}
});
};
});
/**
* @license
* Copyright Google Inc. All Rights Reserved.
@ -3530,9 +3661,23 @@ var wrapFn = function (event) {
}
var target = this || event.target || _global;
var listener = target[eventNameSymbol];
var result = listener && listener.apply(this, arguments);
if (result != undefined && !result) {
event.preventDefault();
var result;
if (isBrowser && target === internalWindow && event.type === 'error') {
// window.onerror have different signiture
// https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror
// and onerror callback will prevent default when callback return true
var errorEvent = event;
result = listener &&
listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);
if (result === true) {
event.preventDefault();
}
}
else {
result = listener && listener.apply(this, arguments);
if (result != undefined && !result) {
event.preventDefault();
}
}
return result;
};
@ -3550,6 +3695,10 @@ function patchProperty(obj, prop, prototype) {
if (!desc || !desc.configurable) {
return;
}
var onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');
if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {
return;
}
// A property descriptor cannot have getter/setter and be writable
// deleting the writable and value properties avoids this error:
//
@ -3627,6 +3776,7 @@ function patchProperty(obj, prop, prototype) {
return null;
};
ObjectDefineProperty(obj, prop, desc);
obj[onPropPatchedSymbol] = true;
}
function patchOnProperties(obj, properties, prototype) {
if (properties) {
@ -3717,6 +3867,31 @@ function patchClass(className) {
}
}
}
function copySymbolProperties(src, dest) {
if (typeof Object.getOwnPropertySymbols !== 'function') {
return;
}
var symbols = Object.getOwnPropertySymbols(src);
symbols.forEach(function (symbol) {
var desc = Object.getOwnPropertyDescriptor(src, symbol);
Object.defineProperty(dest, symbol, {
get: function () {
return src[symbol];
},
set: function (value) {
if (desc && (!desc.writable || typeof desc.set !== 'function')) {
// if src[symbol] is not writable or not have a setter, just return
return;
}
src[symbol] = value;
},
enumerable: desc ? desc.enumerable : true,
configurable: desc ? desc.configurable : true
});
});
}
var shouldCopySymbolProperties = false;
function patchMethod(target, name, patchFn) {
var proto = target;
while (proto && !proto.hasOwnProperty(name)) {
@ -3727,7 +3902,7 @@ function patchMethod(target, name, patchFn) {
proto = target;
}
var delegateName = zoneSymbol(name);
var delegate;
var delegate = null;
if (proto && !(delegate = proto[delegateName])) {
delegate = proto[delegateName] = proto[name];
// check whether proto[name] is writable
@ -3739,6 +3914,9 @@ function patchMethod(target, name, patchFn) {
return patchDelegate_1(this, arguments);
};
attachOriginToPatched(proto[name], delegate);
if (shouldCopySymbolProperties) {
copySymbolProperties(delegate, proto[name]);
}
}
}
return delegate;
@ -3757,7 +3935,7 @@ function patchMacroTask(obj, funcName, metaCreator) {
setNative = patchMethod(obj, funcName, function (delegate) { return function (self, args) {
var meta = metaCreator(self, args);
if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {
return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask, null);
return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);
}
else {
// cause an error by calling it directly.
@ -3771,6 +3949,17 @@ function attachOriginToPatched(patched, original) {
}
var isDetectedIEOrEdge = false;
var ieOrEdge = false;
function isIE() {
try {
var ua = internalWindow.navigator.userAgent;
if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {
return true;
}
}
catch (error) {
}
return false;
}
function isIEOrEdge() {
if (isDetectedIEOrEdge) {
return ieOrEdge;
@ -3852,6 +4041,21 @@ Zone.__load_patch('toString', function (global) {
* @fileoverview
* @suppress {missingRequire}
*/
var passiveSupported = false;
if (typeof window !== 'undefined') {
try {
var options = Object.defineProperty({}, 'passive', {
get: function () {
passiveSupported = true;
}
});
window.addEventListener('test', options, options);
window.removeEventListener('test', options, options);
}
catch (err) {
passiveSupported = false;
}
}
// an identifier to tell ZoneTask do not create a new invoke closure
var OPTIMIZED_ZONE_EVENT_TASK_DATA = {
useG: true
@ -3987,6 +4191,7 @@ function patchEventTarget(_global, apis, patchOptions) {
if (proto[zoneSymbolAddEventListener]) {
return false;
}
var eventNameToString = patchOptions && patchOptions.eventNameToString;
// a shared global taskData to pass data for scheduleEventTask
// so we do not need to create a new object just for pass some data
var taskData = {};
@ -4002,12 +4207,24 @@ function patchEventTarget(_global, apis, patchOptions) {
nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =
proto[patchOptions.prepend];
}
var customScheduleGlobal = function () {
function checkIsPassive(task) {
if (!passiveSupported && typeof taskData.options !== 'boolean' &&
typeof taskData.options !== 'undefined' && taskData.options !== null) {
// options is a non-null non-undefined object
// passive is not supported
// don't pass options as object
// just pass capture as a boolean
task.options = !!taskData.options.capture;
taskData.options = task.options;
}
}
var customScheduleGlobal = function (task) {
// if there is already a task for the eventName + capture,
// just return, because we use the shared globalZoneAwareCallback here.
if (taskData.isExisting) {
return;
}
checkIsPassive(task);
return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);
};
var customCancelGlobal = function (task) {
@ -4048,6 +4265,7 @@ function patchEventTarget(_global, apis, patchOptions) {
return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);
};
var customScheduleNonGlobal = function (task) {
checkIsPassive(task);
return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);
};
var customSchedulePrepend = function (task) {
@ -4070,10 +4288,15 @@ function patchEventTarget(_global, apis, patchOptions) {
if (prepend === void 0) { prepend = false; }
return function () {
var target = this || _global;
var eventName = arguments[0];
var delegate = arguments[1];
if (!delegate) {
return nativeListener.apply(this, arguments);
}
if (isNode && eventName === 'uncaughtException') {
// don't patch uncaughtException of nodejs to prevent endless loop
return nativeListener.apply(this, arguments);
}
// don't create the bind delegate function for handleEvent
// case here to improve addEventListener performance
// we will create the bind delegate when invoke
@ -4087,7 +4310,6 @@ function patchEventTarget(_global, apis, patchOptions) {
if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {
return;
}
var eventName = arguments[0];
var options = arguments[2];
if (blackListedEvents) {
// check black list
@ -4117,8 +4339,8 @@ function patchEventTarget(_global, apis, patchOptions) {
var symbolEventName;
if (!symbolEventNames) {
// the code is duplicate, but I just want to get some better performance
var falseEventName = eventName + FALSE_STR;
var trueEventName = eventName + TRUE_STR;
var falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;
var trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;
var symbol = ZONE_SYMBOL_PREFIX + falseEventName;
var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;
zoneSymbolEventNames$1[eventName] = {};
@ -4153,7 +4375,8 @@ function patchEventTarget(_global, apis, patchOptions) {
source = targetSource[eventName];
}
if (!source) {
source = constructorName + addSource + eventName;
source = constructorName + addSource +
(eventNameToString ? eventNameToString(eventName) : eventName);
}
// do not create a new object as task.data to pass those things
// just use the global shared one
@ -4168,7 +4391,7 @@ function patchEventTarget(_global, apis, patchOptions) {
taskData.capture = capture;
taskData.eventName = eventName;
taskData.isExisting = isExisting;
var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : null;
var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;
// keep taskData into data to allow onScheduleEventTask to access the task information
if (data) {
data.taskData = taskData;
@ -4186,7 +4409,11 @@ function patchEventTarget(_global, apis, patchOptions) {
if (once) {
options.once = true;
}
task.options = options;
if (!(!passiveSupported && typeof task.options === 'boolean')) {
// if not support passive, and we pass an option object
// to addEventListener, we should save the options to task
task.options = options;
}
task.target = target;
task.capture = capture;
task.eventName = eventName;
@ -4271,7 +4498,7 @@ function patchEventTarget(_global, apis, patchOptions) {
var target = this || _global;
var eventName = arguments[0];
var listeners = [];
var tasks = findEventTasks(target, eventName);
var tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
var delegate = task.originalDelegate ? task.originalDelegate : task.callback;
@ -4427,9 +4654,9 @@ function patchTimer(window, setName, cancelName, nameSuffix) {
patchMethod(window, setName, function (delegate) { return function (self, args) {
if (typeof args[0] === 'function') {
var options = {
handleId: null,
isPeriodic: nameSuffix === 'Interval',
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 :
undefined,
args: args
};
var task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);
@ -4544,7 +4771,7 @@ function propertyPatch() {
};
Object.getOwnPropertyDescriptor = function (obj, prop) {
var desc = _getOwnPropertyDescriptor(obj, prop);
if (isUnconfigurable(obj, prop)) {
if (desc && isUnconfigurable(obj, prop)) {
desc.configurable = false;
}
return desc;
@ -4772,10 +4999,10 @@ var globalEventHandlersEventNames = [
'wheel'
];
var documentEventNames = [
'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'fullscreenchange',
'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'freeze', 'fullscreenchange',
'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror',
'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange',
'visibilitychange'
'visibilitychange', 'resume'
];
var windowEventNames = [
'absolutedeviceorientation',
@ -4887,7 +5114,7 @@ var websocketEventNames = ['close', 'error', 'open', 'message'];
var workerEventNames = ['error', 'message'];
var eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);
function filterProperties(target, onProperties, ignoreProperties) {
if (!ignoreProperties) {
if (!ignoreProperties || ignoreProperties.length === 0) {
return onProperties;
}
var tip = ignoreProperties.filter(function (ip) { return ip.target === target; });
@ -4912,13 +5139,14 @@ function propertyDescriptorPatch(api, _global) {
}
var supportsWebSocket = typeof WebSocket !== 'undefined';
if (canPatchViaPropertyDescriptor()) {
var ignoreProperties = _global.__Zone_ignore_on_properties;
var ignoreProperties = _global['__Zone_ignore_on_properties'];
// for browsers that we can patch the descriptor: Chrome & Firefox
if (isBrowser) {
var internalWindow = window;
var ignoreErrorProperties = isIE ? [{ target: internalWindow, ignoreProperties: ['error'] }] : [];
// in IE/Edge, onProp not exist in window object, but in WindowPrototype
// so we need to pass WindowPrototype to check onProp exist or not
patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties, ObjectGetPrototypeOf(internalWindow));
patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));
patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);
if (typeof internalWindow['SVGElement'] !== 'undefined') {
patchFilteredProperties(internalWindow['SVGElement'].prototype, eventNames, ignoreProperties);
@ -4940,9 +5168,9 @@ function propertyDescriptorPatch(api, _global) {
}
}
patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties);
var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget) {
patchFilteredProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames, ignoreProperties);
var XMLHttpRequestEventTarget_1 = _global['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget_1) {
patchFilteredProperties(XMLHttpRequestEventTarget_1 && XMLHttpRequestEventTarget_1.prototype, XMLHttpRequestEventNames, ignoreProperties);
}
if (typeof IDBIndex !== 'undefined') {
patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);
@ -5157,16 +5385,16 @@ function patchEvent(global, api) {
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function registerElementPatch(_global) {
if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
function patchCallbacks(target, targetName, method, callbacks) {
var symbol = Zone.__symbol__(method);
if (target[symbol]) {
return;
}
var _registerElement = document.registerElement;
var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
document.registerElement = function (name, opts) {
var nativeDelegate = target[symbol] = target[method];
target[method] = function (name, opts, options) {
if (opts && opts.prototype) {
callbacks.forEach(function (callback) {
var source = 'Document.registerElement::' + callback;
var source = targetName + "." + method + "::" + callback;
var prototype = opts.prototype;
if (prototype.hasOwnProperty(callback)) {
var descriptor = ObjectGetOwnPropertyDescriptor(prototype, callback);
@ -5183,9 +5411,23 @@ function registerElementPatch(_global) {
}
});
}
return _registerElement.call(document, name, opts);
return nativeDelegate.call(target, name, opts, options);
};
attachOriginToPatched(document.registerElement, _registerElement);
attachOriginToPatched(target[method], nativeDelegate);
}
function registerElementPatch(_global) {
if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
return;
}
var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
patchCallbacks(document, 'Document', 'registerElement', callbacks);
}
function patchCustomElements(_global) {
if ((!isBrowser && !isMix) || !('customElements' in _global)) {
return;
}
var callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback'];
patchCallbacks(_global.customElements, 'customElements', 'define', callbacks);
}
/**
@ -5248,7 +5490,10 @@ Zone.__load_patch('EventTarget', function (global, Zone, api) {
Zone.__load_patch('on_property', function (global, Zone, api) {
propertyDescriptorPatch(api, global);
propertyPatch();
});
Zone.__load_patch('customElements', function (global, Zone, api) {
registerElementPatch(global);
patchCustomElements(global);
});
Zone.__load_patch('canvas', function (global) {
var HTMLCanvasElement = global['HTMLCanvasElement'];
@ -5267,6 +5512,7 @@ Zone.__load_patch('XHR', function (global, Zone) {
var XHR_LISTENER = zoneSymbol('xhrListener');
var XHR_SCHEDULED = zoneSymbol('xhrScheduled');
var XHR_URL = zoneSymbol('xhrURL');
var XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');
function patchXHR(window) {
var XMLHttpRequestPrototype = XMLHttpRequest.prototype;
function findPendingTask(target) {
@ -5275,9 +5521,9 @@ Zone.__load_patch('XHR', function (global, Zone) {
var oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
var oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
if (!oriAddListener) {
var XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget) {
var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;
var XMLHttpRequestEventTarget_1 = window['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget_1) {
var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget_1.prototype;
oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
}
@ -5285,9 +5531,10 @@ Zone.__load_patch('XHR', function (global, Zone) {
var READY_STATE_CHANGE = 'readystatechange';
var SCHEDULED = 'scheduled';
function scheduleTask(task) {
XMLHttpRequest[XHR_SCHEDULED] = false;
var data = task.data;
var target = data.target;
target[XHR_SCHEDULED] = false;
target[XHR_ERROR_BEFORE_SCHEDULED] = false;
// remove existing event listener
var listener = target[XHR_LISTENER];
if (!oriAddListener) {
@ -5301,8 +5548,35 @@ Zone.__load_patch('XHR', function (global, Zone) {
if (target.readyState === target.DONE) {
// sometimes on some browsers XMLHttpRequest will fire onreadystatechange with
// readyState=4 multiple times, so we need to check task state here
if (!data.aborted && XMLHttpRequest[XHR_SCHEDULED] && task.state === SCHEDULED) {
task.invoke();
if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {
// check whether the xhr has registered onload listener
// if that is the case, the task should invoke after all
// onload listeners finish.
var loadTasks = target['__zone_symbol__loadfalse'];
if (loadTasks && loadTasks.length > 0) {
var oriInvoke_1 = task.invoke;
task.invoke = function () {
// need to load the tasks again, because in other
// load listener, they may remove themselves
var loadTasks = target['__zone_symbol__loadfalse'];
for (var i = 0; i < loadTasks.length; i++) {
if (loadTasks[i] === task) {
loadTasks.splice(i, 1);
}
}
if (!data.aborted && task.state === SCHEDULED) {
oriInvoke_1.call(task);
}
};
loadTasks.push(task);
}
else {
task.invoke();
}
}
else if (!data.aborted && target[XHR_SCHEDULED] === false) {
// error occurs when xhr.send()
target[XHR_ERROR_BEFORE_SCHEDULED] = true;
}
}
};
@ -5312,7 +5586,7 @@ Zone.__load_patch('XHR', function (global, Zone) {
target[XHR_TASK] = task;
}
sendNative.apply(target, data.args);
XMLHttpRequest[XHR_SCHEDULED] = true;
target[XHR_SCHEDULED] = true;
return task;
}
function placeholderCallback() { }
@ -5329,24 +5603,32 @@ Zone.__load_patch('XHR', function (global, Zone) {
return openNative.apply(self, args);
}; });
var XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';
var fetchTaskAborting = zoneSymbol('fetchTaskAborting');
var fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');
var sendNative = patchMethod(XMLHttpRequestPrototype, 'send', function () { return function (self, args) {
if (Zone.current[fetchTaskScheduling] === true) {
// a fetch is scheduling, so we are using xhr to polyfill fetch
// and because we already schedule macroTask for fetch, we should
// not schedule a macroTask for xhr again
return sendNative.apply(self, args);
}
if (self[XHR_SYNC]) {
// if the XHR is sync there is no task to schedule, just execute the code.
return sendNative.apply(self, args);
}
else {
var options = {
target: self,
url: self[XHR_URL],
isPeriodic: false,
delay: null,
args: args,
aborted: false
};
return scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
var options = { target: self, url: self[XHR_URL], isPeriodic: false, args: args, aborted: false };
var task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted &&
task.state === SCHEDULED) {
// xhr request throw error when send
// we should invoke task instead of leaving a scheduled
// pending macroTask
task.invoke();
}
}
}; });
var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () { return function (self) {
var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () { return function (self, args) {
var task = findPendingTask(self);
if (task && typeof task.type == 'string') {
// If the XHR has already completed, do nothing.
@ -5358,6 +5640,10 @@ Zone.__load_patch('XHR', function (global, Zone) {
}
task.zone.cancelTask(task);
}
else if (Zone.current[fetchTaskAborting] === true) {
// the abort is called from fetch polyfill, we need to call native abort of XHR.
return abortNative.apply(self, args);
}
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no
// task
// to cancel. Do nothing.
@ -5497,8 +5783,8 @@ __webpack_require__.r(__webpack_exports__);
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
module.exports = __webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
__webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
module.exports = __webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
/***/ })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -89615,6 +89615,22 @@ var NotIdle = /** @class */ (function (_super) {
//# sourceMappingURL=/home/travis/build/harunurhan/idlejs/src/not-idle.js.map
/***/ }),
/***/ "./node_modules/isarray/index.js":
/*!***************************************!*\
!*** ./node_modules/isarray/index.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/***/ "./node_modules/json-bignumber/node_modules/bignumber.js/bignumber.js":
@ -94787,9 +94803,13 @@ exports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {
var Buffer = __webpack_require__(/*! ../utils/buffer */ "./node_modules/qrcode/lib/utils/typedarray-buffer.js")
var EXP_TABLE = new Buffer(512)
var LOG_TABLE = new Buffer(256)
if(Buffer.alloc) {
var EXP_TABLE = Buffer.alloc(512)
var LOG_TABLE = Buffer.alloc(256)
} else {
var EXP_TABLE = new Buffer(512)
var LOG_TABLE = new Buffer(256)
}
/**
* Precompute the log and anti-log tables for faster computation later
*
@ -95499,7 +95519,7 @@ var Version = __webpack_require__(/*! ./version */ "./node_modules/qrcode/lib/co
var FormatInfo = __webpack_require__(/*! ./format-info */ "./node_modules/qrcode/lib/core/format-info.js")
var Mode = __webpack_require__(/*! ./mode */ "./node_modules/qrcode/lib/core/mode.js")
var Segments = __webpack_require__(/*! ./segments */ "./node_modules/qrcode/lib/core/segments.js")
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
/**
* QRCode for JavaScript
@ -96547,7 +96567,7 @@ var ECCode = __webpack_require__(/*! ./error-correction-code */ "./node_modules/
var ECLevel = __webpack_require__(/*! ./error-correction-level */ "./node_modules/qrcode/lib/core/error-correction-level.js")
var Mode = __webpack_require__(/*! ./mode */ "./node_modules/qrcode/lib/core/mode.js")
var VersionCheck = __webpack_require__(/*! ./version-check */ "./node_modules/qrcode/lib/core/version-check.js")
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
// Generator polynomial used to encode version information
var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)
@ -96997,7 +97017,7 @@ exports.qrToImageData = function qrToImageData (imgData, qr, opts) {
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
function typedArraySupport () {
// Can typed array instances be augmented?
@ -97502,22 +97522,6 @@ Buffer.isBuffer = function isBuffer (b) {
module.exports = Buffer
/***/ }),
/***/ "./node_modules/qrcode/node_modules/isarray/index.js":
/*!***********************************************************!*\
!*** ./node_modules/qrcode/node_modules/isarray/index.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/***/ "./node_modules/rxjs/_esm5/index.js":

File diff suppressed because one or more lines are too long

View file

@ -485,19 +485,6 @@ export class BackendService {
this.runCommand('open_url_in_browser', url, callback);
}
is_remnotenode_mode_preconfigured(callback) {
this.runCommand('is_remnotenode_mode_preconfigured', {}, callback);
}
start_backend(node, host, port, callback) {
const params = {
configure_for_remote_node: node,
remote_node_host: host,
remote_node_port: parseInt(port, 10)
};
this.runCommand('start_backend', params, callback);
}
getDefaultFee(callback) {
this.runCommand('get_default_fee', {}, callback);
}

View file

@ -66,15 +66,6 @@ export class AppComponent implements OnInit, OnDestroy {
this.backend.webkitLaunchedScript();
this.backend.is_remnotenode_mode_preconfigured((status, data) => {
// if (data === 'FALSE') {
// } else {
// }
this.backend.start_backend(false, '127.0.0.1', 11512, (st2, dd2) => {
console.log(st2, dd2);
});
});
this.backend.eventSubscribe('quit_requested', () => {
if (!this.onQuitRequest) {
this.ngZone.run(() => {

View file

@ -156,6 +156,8 @@ namespace currency
m_core.get_blockchain_storage().get_top_block(b);
res.last_block_total_reward = currency::get_reward_from_miner_tx(b.miner_tx);
res.pos_diff_total_coins_rate = (pos_diff / (res.total_coins - PREMINE_AMOUNT + 1)).convert_to<uint64_t>();
res.last_block_timestamp = b.timestamp;
res.last_block_hash = string_tools::pod_to_hex(get_block_hash(b));
}
if (req.flags&COMMAND_RPC_GET_INFO_FLAG_POS_BLOCK_TS_SHIFT_VS_ACTUAL)
{

View file

@ -660,6 +660,8 @@ namespace currency
uint64_t tx_count_in_last_block;
uint64_t default_fee;
uint64_t minimum_fee;
uint64_t last_block_timestamp;
std::string last_block_hash;
//market
uint64_t offers_count;
@ -708,6 +710,8 @@ namespace currency
KV_SERIALIZE(tx_count_in_last_block)
KV_SERIALIZE(default_fee)
KV_SERIALIZE(minimum_fee)
KV_SERIALIZE(last_block_timestamp)
KV_SERIALIZE(last_block_hash)
KV_SERIALIZE(offers_count)
END_KV_SERIALIZE_MAP()
};

View file

@ -1757,6 +1757,11 @@ namespace
}
}
//----------------------------------------------------------------------------------------------------
void wallet2::init_log_prefix()
{
m_log_prefix = m_account.get_public_address_str().substr(0, 6);
}
//----------------------------------------------------------------------------------------------------
void wallet2::load_keys(const std::string& buff, const std::string& password)
{
wallet2::keys_file_data keys_file_data;
@ -1781,14 +1786,14 @@ void wallet2::load_keys(const std::string& buff, const std::string& password)
WLT_LOG_L0("Wrong password for wallet " << string_encoding::convert_to_ansii(m_wallet_file));
tools::error::throw_wallet_ex<error::invalid_password>(std::string(__FILE__ ":" STRINGIZE(__LINE__)));
}
m_log_prefix = m_account.get_public_address_str().substr(0, 6);
init_log_prefix();
}
//----------------------------------------------------------------------------------------------------
void wallet2::assign_account(const currency::account_base& acc)
{
clear();
m_account = acc;
init_log_prefix();
}
//----------------------------------------------------------------------------------------------------
void wallet2::generate(const std::wstring& path, const std::string& pass)
@ -1797,6 +1802,7 @@ void wallet2::generate(const std::wstring& path, const std::string& pass)
m_wallet_file = path;
m_password = pass;
m_account.generate();
init_log_prefix();
boost::system::error_code ignored_ec;
THROW_IF_TRUE_WALLET_EX(boost::filesystem::exists(m_wallet_file, ignored_ec), error::file_exists, epee::string_encoding::convert_to_ansii(m_wallet_file));
store();
@ -1808,6 +1814,7 @@ void wallet2::restore(const std::wstring& path, const std::string& pass, const s
m_wallet_file = path;
m_password = pass;
bool r = m_account.restore_keys_from_braindata(restore_key);
init_log_prefix();
THROW_IF_TRUE_WALLET_EX(!r, error::wallet_internal_error, epee::string_encoding::convert_to_ansii(m_wallet_file));
boost::system::error_code ignored_ec;
THROW_IF_TRUE_WALLET_EX(boost::filesystem::exists(m_wallet_file, ignored_ec), error::file_exists, epee::string_encoding::convert_to_ansii(m_wallet_file));

View file

@ -599,6 +599,8 @@ private:
void fill_transfer_details(const currency::transaction& tx, const tools::money_transfer2_details& td, tools::wallet_rpc::wallet_transfer_info_details& res_td) const;
void print_source_entry(const currency::tx_source_entry& src) const;
void init_log_prefix();
struct construct_tx_param
{
std::vector<currency::tx_destination_entry> dsts;

View file

@ -62,11 +62,9 @@ add_test(coretests coretests)
# set PCH for core_tests
if(MSVC)
if(MSVC AND USE_PCH)
set_property(TARGET coretests APPEND_STRING PROPERTY COMPILE_FLAGS " /Yuchaingen.h /Zm1000")
set_property(SOURCE "core_tests/chaingen.cpp" APPEND_STRING PROPERTY COMPILE_FLAGS " /Ycchaingen.h /Zm1000")
if(USE_PCH) # see also src/CMakeLists.txt for details
set_property(TARGET coretests difficulty-tests functional_tests hash-target-tests performance_tests unit_tests APPEND_STRING PROPERTY LINK_FLAGS "$(MSBuildProjectDirectory)/../src/$(ConfigurationName)/stdafx.obj")
set_property(TARGET db_tests APPEND_STRING PROPERTY LINK_FLAGS "$(MSBuildProjectDirectory)/../../src/$(ConfigurationName)/stdafx.obj")
endif()
set_property(TARGET coretests difficulty-tests functional_tests hash-target-tests performance_tests unit_tests APPEND_STRING PROPERTY LINK_FLAGS "$(MSBuildProjectDirectory)/../src/$(ConfigurationName)/stdafx.obj")
set_property(TARGET db_tests APPEND_STRING PROPERTY LINK_FLAGS "$(MSBuildProjectDirectory)/../../src/$(ConfigurationName)/stdafx.obj")
endif()

View file

@ -1,3 +1,3 @@
add_executable(db_tests db_tests.cpp)
target_link_libraries(db_tests crypto common lmdb zlib ${Boost_LIBRARIES})
target_link_libraries(db_tests crypto common lmdb zlibstatic ${Boost_LIBRARIES})

View file

@ -4,4 +4,4 @@ cd ..
@mkdir build_msvc2013_64
cd build_msvc2013_64
cmake -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2013_64 -D BUILD_GUI=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-12.0" -G "Visual Studio 12 2013 Win64" ".."
cmake -D BUILD_TESTS=TRUE -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2013_64 -D BUILD_GUI=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-12.0" -G "Visual Studio 12 2013 Win64" ".."

View file

@ -4,4 +4,4 @@ cd ..
@mkdir build_msvc2015_64
cd build_msvc2015_64
cmake -D USE_PCH=TRUE -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2015_64 -D BUILD_GUI=TRUE -D USE_OPENCL=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-14.0" -G "Visual Studio 14 2015 Win64" -T host=x64 ".."
cmake -D USE_PCH=TRUE -D BUILD_TESTS=TRUE -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2015_64 -D BUILD_GUI=TRUE -D USE_OPENCL=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-14.0" -G "Visual Studio 14 2015 Win64" -T host=x64 ".."

View file

@ -4,4 +4,4 @@ cd ..
@mkdir build_msvc2017_64
cd build_msvc2017_64
cmake -D USE_PCH=TRUE -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2017_64 -D BUILD_GUI=TRUE -D USE_OPENCL=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -T host=x64 ".."
cmake -D USE_PCH=TRUE -D BUILD_TESTS=TRUE -D CMAKE_PREFIX_PATH="%QT_PREFIX_PATH%"\msvc2017_64 -D BUILD_GUI=TRUE -D USE_OPENCL=TRUE -D STATIC=FALSE -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_ROOT%\lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -T host=x64 ".."