on master help sign in
Merge pull request #192 from urbit/unhappy-fixes
81a795bFang
src/lib/txn.js+11−6
@@ -165,11 +165,16 @@ const sendSignedTransaction = (web3, stx, doubtNonceError, confirmationCb) => {
165 // that it's because the tank already submitted our transaction.
165 // that it's because the tank already submitted our transaction.
166 // we just wait for first confirmation here.
166 // we just wait for first confirmation here.
167 console.error(err);
167 console.error(err);
168− if (
168+ const isKnownError = (err.message || '').includes(
169− doubtNonceError &&
169+ 'known transaction: '
170+ );
171+ const isNonceError = (err.message || '').includes(
170− (err.message || '').includes("the tx doesn't have the correct nonce.")
172+ "the tx doesn't have the correct nonce."
171− ) {
173+ );
174+ if (isKnownError || (doubtNonceError && isNonceError)) {
175+ console.log(
172− console.log('nonce error, likely from gas tank submission, ignoring');
176+ 'tx send error likely from gas tank submission, ignoring'
177+ );
173 const txHash = web3.utils.keccak256(rawTx);
178 const txHash = web3.utils.keccak256(rawTx);
174 //TODO can we do does-exists check first?
179 //TODO can we do does-exists check first?
175 //TODO max wait time before assume fail?
180 //TODO max wait time before assume fail?
@@ -182,7 +187,7 @@ const sendSignedTransaction = (web3, stx, doubtNonceError, confirmationCb) => {
182 }
187 }
183 });
188 });
184 } else {
189 } else {
185− reject(err.message);
190+ reject(err.message || 'Transaction sending failed!');
186 }
191 }
187 });
192 });
188 });
193 });
src/views/Activate/ActivateCode.js+2
@@ -93,6 +93,8 @@ export default function ActivateCode() {
93 'This invite code has multiple points available.\n' +
93 'This invite code has multiple points available.\n' +
94 "Once you've activated this point, activate the next with the same process."
94 "Once you've activated this point, activate the next with the same process."
95 );
95 );
96+ } else {
97+ setGeneralError(false);
96 }
98 }
97 } else {
99 } else {
98 setGeneralError(
100 setGeneralError(