Browse Source

commented out timeout/immediate params

all-modes
pbca26 8 years ago
parent
commit
d25c2a92b1
  1. 180
      react/src/actions/actionCreators.js
  2. 17
      react/src/components/dashboard/coinTileItem.js
  3. 2
      react/src/components/dashboard/walletsNativeTxHistory.js

180
react/src/actions/actionCreators.js

@ -216,6 +216,8 @@ function iguanaWalletPassphraseState(json, dispatch) {
console.log('iguanaWalletPassphraseState', json); console.log('iguanaWalletPassphraseState', json);
sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json)); sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json));
dispatch(triggerToaster(true, translate('TOASTR.LOGIN_SUCCESSFULL'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'success')); dispatch(triggerToaster(true, translate('TOASTR.LOGIN_SUCCESSFULL'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'success'));
dispatch(getMainAddressState(json));
dispatch(iguanaActiveHandleState(json));
return { return {
type: LOGIN, type: LOGIN,
@ -585,8 +587,8 @@ export function getDexCoins() {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'InstantDEX', 'agent': 'InstantDEX',
'method': 'allcoins', 'method': 'allcoins',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}) })
}) })
.catch(function(error) { .catch(function(error) {
@ -618,7 +620,7 @@ export function iguanaWalletPassphrase(_passphrase) {
'timeout': '2592000', 'timeout': '2592000',
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'walletpassphrase', 'method': 'walletpassphrase',
'immediate': 60000, // 'immediate': 60000,
}), }),
}) })
.catch(function(error) { .catch(function(error) {
@ -638,8 +640,8 @@ export function iguanaActiveHandle(getMainAddress) {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'SuperNET', 'agent': 'SuperNET',
'method': 'activehandle', 'method': 'activehandle',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}), }),
}) })
.catch(function(error) { .catch(function(error) {
@ -661,8 +663,8 @@ export function iguanaEdexBalance(coin) {
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'getbalance', 'method': 'getbalance',
'coin': coin, 'coin': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}), }),
}) })
.catch(function(error) { .catch(function(error) {
@ -703,8 +705,8 @@ export function encryptWallet(_passphrase, cb, coin) {
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'encryptwallet', 'method': 'encryptwallet',
'passphrase': _passphrase, 'passphrase': _passphrase,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -729,7 +731,7 @@ export function walletPassphrase(_passphrase) {
'method': 'walletpassphrase', 'method': 'walletpassphrase',
'password': _passphrase, 'password': _passphrase,
'timeout': '2592000', 'timeout': '2592000',
'immediate': 60000, // 'immediate': 60000,
}; };
return dispatch => { return dispatch => {
@ -778,8 +780,8 @@ export function getFullTransactionsList(coin) {
9999999, 9999999,
[] []
], ],
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -805,8 +807,8 @@ export function getBasiliskTransactionsList(coin, address) {
'count': 100, 'count': 100,
'skip': 0, 'skip': 0,
'symbol': coin, 'symbol': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
//if (sessionStorage.getItem('useCache')) { //if (sessionStorage.getItem('useCache')) {
@ -857,8 +859,8 @@ export function getPeersList(coin) {
'agent': 'SuperNET', 'agent': 'SuperNET',
'method': 'getpeers', 'method': 'getpeers',
'activecoin': coin, 'activecoin': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -905,8 +907,8 @@ export function addPeerNode(coin, ip) {
'method': 'addnode', 'method': 'addnode',
'activecoin': coin, 'activecoin': coin,
'ipaddr': ip, 'ipaddr': ip,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -954,8 +956,8 @@ export function getAddressesByAccount(coin, mode) {
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount', 'method': 'getaddressesbyaccount',
'account': '*', 'account': '*',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -1011,8 +1013,8 @@ export function getSyncInfo(coin) {
'coin': coin, 'coin': coin,
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'getinfo', 'method': 'getinfo',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -1078,8 +1080,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'asset': coin, 'asset': coin,
'function': ajax_function_input, 'function': ajax_function_input,
'hex': tmplistaddr_hex_input, 'hex': tmplistaddr_hex_input,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1088,8 +1090,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'method': 'passthru', 'method': 'passthru',
'function': ajax_function_input, 'function': ajax_function_input,
'hex': tmplistaddr_hex_input, 'hex': tmplistaddr_hex_input,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1100,8 +1102,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount', 'method': 'getaddressesbyaccount',
'account': '*', 'account': '*',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1154,8 +1156,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'asset': coin, 'asset': coin,
'function': 'listunspent', 'function': 'listunspent',
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1164,8 +1166,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'method': 'passthru', 'method': 'passthru',
'function': 'listunspent', 'function': 'listunspent',
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1178,8 +1180,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
1, 1,
9999999, 9999999,
], ],
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1191,8 +1193,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'method': 'listunspent', 'method': 'listunspent',
'address': currentAddress, 'address': currentAddress,
'symbol': coin, 'symbol': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1493,8 +1495,8 @@ export function importPrivKey(wifKey) {
wifKey, wifKey,
'imported' 'imported'
], ],
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -1532,7 +1534,7 @@ export function shepherdGetSysInfo() {
} }
} }
export function getSyncInfoNativeKMD() { export function getSyncInfoNativeKMD(skipDebug) {
const coin = 'KMD'; const coin = 'KMD';
return dispatch => { return dispatch => {
@ -1545,13 +1547,17 @@ export function getSyncInfoNativeKMD() {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(getSyncInfoNativeState({ 'remoteKMDNode': json }))) .then(json => dispatch(getSyncInfoNativeState({ 'remoteKMDNode': json })))
.then(dispatch(getDebugLog('komodo', 1))) .then(function() {
if (!skipDebug) {
dispatch(getDebugLog('komodo', 1));
}
})
} }
} }
function getSyncInfoNativeState(json) { function getSyncInfoNativeState(json, coin, skipDebug) {
if (json && json.error) { if (coin === 'KMD' && json && json.error) {
return getSyncInfoNativeKMD(); return getSyncInfoNativeKMD(skipDebug);
} else { } else {
return { return {
type: SYNCING_NATIVE_MODE, type: SYNCING_NATIVE_MODE,
@ -1571,7 +1577,7 @@ function getPassthruAgent(coin) {
return passthru_agent; return passthru_agent;
} }
export function getSyncInfoNative(coin) { export function getSyncInfoNative(coin, skipDebug) {
var payload = {}; var payload = {};
payload = { payload = {
@ -1581,8 +1587,8 @@ export function getSyncInfoNative(coin) {
'asset': coin, 'asset': coin,
'function': 'getinfo', 'function': 'getinfo',
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -1595,7 +1601,7 @@ export function getSyncInfoNative(coin) {
dispatch(triggerToaster(true, 'getSyncInfo', 'Error', 'error')); dispatch(triggerToaster(true, 'getSyncInfo', 'Error', 'error'));
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(getSyncInfoNativeState(json, dispatch))) .then(json => dispatch(getSyncInfoNativeState(json, coin, skipDebug)))
} }
} }
@ -1607,8 +1613,8 @@ export function getDexBalance(coin, addr) {
'method': 'listunspent', 'method': 'listunspent',
'address': _addr, 'address': _addr,
'symbol': coin, 'symbol': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
console.log('addr', _addr); console.log('addr', _addr);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -1643,7 +1649,7 @@ export function getKMDBalanceTotal(coin) {
'asset': coin, 'asset': coin,
'function': 'z_gettotalbalance', 'function': 'z_gettotalbalance',
'hex': '3000', 'hex': '3000',
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1652,7 +1658,7 @@ export function getKMDBalanceTotal(coin) {
'method': 'passthru', 'method': 'passthru',
'function': 'z_gettotalbalance', 'function': 'z_gettotalbalance',
'hex': '3000', 'hex': '3000',
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1692,8 +1698,8 @@ export function getNativeTxHistory(coin) {
'asset': coin, 'asset': coin,
'function': 'listtransactions', 'function': 'listtransactions',
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1702,8 +1708,8 @@ export function getNativeTxHistory(coin) {
'method': 'passthru', 'method': 'passthru',
'function': 'listtransactions', 'function': 'listtransactions',
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1762,8 +1768,8 @@ export function getNewKMDAddresses(coin, pubpriv) {
'asset': coin, 'asset': coin,
'function': ajax_function_input, 'function': ajax_function_input,
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1772,8 +1778,8 @@ export function getNewKMDAddresses(coin, pubpriv) {
'method': 'passthru', 'method': 'passthru',
'function': ajax_function_input, 'function': ajax_function_input,
'hex': '', 'hex': '',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1800,8 +1806,8 @@ export function iguanaHashHex(data) {
'agent': 'hash', 'agent': 'hash',
'method': 'hex', 'method': 'hex',
'message': data, 'message': data,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -1834,8 +1840,8 @@ export function sendNativeTx(coin, _payload) {
'asset': coin, 'asset': coin,
'function': 'z_sendmany', 'function': 'z_sendmany',
'hex': hashHexJson, 'hex': hashHexJson,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1844,8 +1850,8 @@ export function sendNativeTx(coin, _payload) {
'method': 'passthru', 'method': 'passthru',
'function': 'z_sendmany', 'function': 'z_sendmany',
'hex': hashHexJson, 'hex': hashHexJson,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1908,8 +1914,8 @@ export function getKMDOPID(opid, coin) {
'asset': coin, 'asset': coin,
'function': 'z_getoperationstatus', 'function': 'z_getoperationstatus',
'hex': hashHexJson, 'hex': hashHexJson,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} else { } else {
payload = { payload = {
@ -1918,8 +1924,8 @@ export function getKMDOPID(opid, coin) {
'method': 'passthru', 'method': 'passthru',
'function': 'z_getoperationstatus', 'function': 'z_getoperationstatus',
'hex': hashHexJson, 'hex': hashHexJson,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
} }
@ -1980,8 +1986,8 @@ export function sendToAddress(coin, _payload) {
'EasyDEX', 'EasyDEX',
'EasyDEXTransaction' 'EasyDEXTransaction'
], ],
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2010,8 +2016,8 @@ export function sendFromAddress(coin, _payload) {
'EasyDEX', 'EasyDEX',
'EasyDEXTransaction' 'EasyDEXTransaction'
], ],
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2049,8 +2055,8 @@ export function checkAddressBasilisk(coin, address) {
'method': 'checkaddress', 'method': 'checkaddress',
'address': address, 'address': address,
'symbol': coin, 'symbol': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2091,8 +2097,8 @@ export function validateAddressBasilisk(coin, address) {
'method': 'validateaddress', 'method': 'validateaddress',
'address': address, 'address': address,
'symbol': coin, 'symbol': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2128,8 +2134,8 @@ export function getDexNotaries(coin) {
'agent': 'dex', 'agent': 'dex',
'method': 'getnotaries', 'method': 'getnotaries',
'symbol': coin, 'symbol': coin,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2164,8 +2170,8 @@ export function createNewWallet(_passphrase) {
'agent': 'bitcoinrpc', 'agent': 'bitcoinrpc',
'method': 'encryptwallet', 'method': 'encryptwallet',
'passphrase': _passphrase, 'passphrase': _passphrase,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2253,8 +2259,8 @@ function initNotaryNodesConSequence(nodes) {
'agent': 'dex', 'agent': 'dex',
'method': 'getinfo', 'method': 'getinfo',
'symbol': node, 'symbol': node,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -2407,8 +2413,8 @@ export function connectNotaries() {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'dpow', 'agent': 'dpow',
'method': 'notarychains,', 'method': 'notarychains,',
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
return dispatch => { return dispatch => {
@ -2440,8 +2446,8 @@ export function iguanaUTXORawTX(data) {
'sendflag': data.sendsig 'sendflag': data.sendsig
}, },
'utxos': data.utxos, 'utxos': data.utxos,
'immediate': 60000, // 'immediate': 60000,
'timeout': 60000 // 'timeout': 60000
}; };
console.log('iguanaUTXORawTXExport', payload); console.log('iguanaUTXORawTXExport', payload);

17
react/src/components/dashboard/coinTileItem.js

@ -39,11 +39,18 @@ class CoinTileItem extends React.Component {
dispatchCoinActions(coin, mode) { dispatchCoinActions(coin, mode) {
if (mode === 'native') { if (mode === 'native') {
Store.dispatch(iguanaActiveHandle(true)); Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getSyncInfoNative(coin)); if (this.props.Dashboard.progress &&
Store.dispatch(getKMDBalanceTotal(coin)); this.props.Dashboard.progress.blocks &&
Store.dispatch(getNativeTxHistory(coin)); this.props.Dashboard.progress.longestchain &&
Store.dispatch(getKMDAddressesNative(coin, mode)); this.props.Dashboard.progress.blocks === this.props.Dashboard.progress.longestchain) {
Store.dispatch(getKMDOPID(null, coin)); Store.dispatch(getSyncInfoNative(coin, true));
Store.dispatch(getKMDBalanceTotal(coin));
Store.dispatch(getNativeTxHistory(coin));
Store.dispatch(getKMDAddressesNative(coin, mode));
Store.dispatch(getKMDOPID(null, coin));
} else {
Store.dispatch(getSyncInfoNative(coin));
}
} }
if (mode === 'full') { if (mode === 'full') {
Store.dispatch(iguanaActiveHandle(true)); Store.dispatch(iguanaActiveHandle(true));

2
react/src/components/dashboard/walletsNativeTxHistory.js

@ -83,7 +83,7 @@ class WalletsNativeTxHistory extends React.Component {
if (!this.state.itemsList || if (!this.state.itemsList ||
(this.state.itemsList && !this.state.itemsList.length) || (this.state.itemsList && !this.state.itemsList.length) ||
(props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) { (props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading') { if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory !== 'no data') {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory); let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage); historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage);

Loading…
Cancel
Save