@@ -148,13 +148,12 @@ export async function reticketPointBetweenWallets({
148148
149149 progress(TRANSACTION_PROGRESS.SIGNING);
150150
151− const suggestedGasPrice = await getSuggestedGasPrice(networkType);
151+ const gasPriceGwei = (await getSuggestedGasPrice(networkType)).toFixed();
152152 const chainId = await web3.eth.net.getId();
153− const gasPrice = safeToWei(suggestedGasPrice.toFixed(), 'gwei');
154− const gasPriceBN = toBN(gasPrice);
153+ const gasPriceWeiBN = toBN(safeToWei(gasPriceGwei, 'gwei'));
155154 let inviteNonce = await web3.eth.getTransactionCount(fromWallet.address);
156155 const totalCost = txs.reduce(
157− (acc, tx) => acc.add(gasPriceBN.mul(toBN(tx.gas))),
156+ (acc, tx) => acc.add(gasPriceWeiBN.mul(toBN(tx.gas))),
158157 toBN(0)
159158 );
160159
@@ -170,7 +169,7 @@ export async function reticketPointBetweenWallets({
170169 txn: txs[i],
171170 nonce: inviteNonce + i,
172171 chainId,
173− gasPrice: suggestedGasPrice.toFixed(),
172+ gasPrice: gasPriceGwei,
174173 gasLimit: txs[i].gas,
175174 });
176175 txPairs.push({
@@ -215,29 +214,30 @@ export async function reticketPointBetweenWallets({
215214 // if non-trivial eth left in invite wallet, transfer to new ownership
216215 let balance = toBN(await web3.eth.getBalance(fromWallet.address));
217216 const gasLimit = GAS_LIMITS.SEND_ETH;
218− const sendEthCost = gasPriceBN.mul(toBN(gasLimit));
217+ const sendEthCost = gasPriceWeiBN.mul(toBN(gasLimit));
219218 if (transferEth && balance.gt(sendEthCost)) {
220− const value = balance.sub(sendEthCost);
221− const txn = {
222− to: toWallet.ownership.keys.address,
223− value: value,
224− };
225− const stx = signTransaction({
226− wallet: fromWallet,
227− walletType: fromWalletType,
228− walletHdPath: fromWalletHdPath,
229− txn,
230− chainId,
231− networkType,
232− gasPrice: gasPriceBN,
233− gasLimit,
234− nonce: inviteNonce++,
235− });
236− // let stx = new Tx(tx);
237− // stx.sign(fromWallet.privateKey);
238− sendSignedTransaction(web3, stx).catch(err => {
239− console.log('error sending value tx, who cares', err);
240− });
219+ try {
220+ const value = balance.sub(sendEthCost);
221+ const txn = {
222+ to: toWallet.ownership.keys.address,
223+ value: value,
224+ };
225+ const stx = await signTransaction({
226+ wallet: fromWallet,
227+ walletType: fromWalletType,
228+ walletHdPath: fromWalletHdPath,
229+ txn,
230+ chainId,
231+ networkType,
232+ gasPrice: gasPriceGwei,
233+ gasLimit,
234+ nonce: inviteNonce,
235+ });
236+ sendSignedTransaction(web3, stx);
237+ } catch (err) {
238+ console.log('error sending value tx, safely ignored:');
239+ console.log(err);
240+ }
241241 }
242242
243243 progress(TRANSACTION_PROGRESS.DONE);