on master help sign in
Ensure we generate the keyfile for latest-set keys
bacec7eFang
src/bridge/Bridge.js+5−2
@@ -190,9 +190,10 @@ class Bridge extends React.Component {
190 }
190 }
191 }
191 }
192
192
193− setNetworkSeedCache(networkSeed) {
193+ setNetworkSeedCache(networkSeed, revision) {
194 this.setState({
194 this.setState({
195− networkSeedCache: networkSeed
195+ networkSeedCache: networkSeed,
196+ networkRevisionCache: revision
196 })
197 })
197 }
198 }
198
199
@@ -263,6 +264,7 @@ class Bridge extends React.Component {
263 urbitWallet,
264 urbitWallet,
264 authMnemonic,
265 authMnemonic,
265 networkSeedCache,
266 networkSeedCache,
267+ networkRevisionCache,
266 pointCursor,
268 pointCursor,
267 pointCache,
269 pointCache,
268 txnHashCursor,
270 txnHashCursor,
@@ -316,6 +318,7 @@ class Bridge extends React.Component {
316 pointCursor={ pointCursor }
318 pointCursor={ pointCursor }
317 pointCache={ pointCache }
319 pointCache={ pointCache }
318 networkSeedCache= { networkSeedCache }
320 networkSeedCache= { networkSeedCache }
321+ networkRevisionCache={ networkRevisionCache }
319 setNetworkSeedCache= { this.setNetworkSeedCache }
322 setNetworkSeedCache= { this.setNetworkSeedCache }
320 // txn
323 // txn
321 setTxnHashCursor={ this.setTxnHashCursor }
324 setTxnHashCursor={ this.setTxnHashCursor }
src/bridge/components/StatelessTransaction.js+3−2
@@ -93,8 +93,9 @@ class StatelessTransaction extends React.Component {
93 props.setTxnHashCursor(sent)
93 props.setTxnHashCursor(sent)
94 props.popRoute()
94 props.popRoute()
95
95
96+ //TODO this special logic should live in a handler in SetKeys.
96− if (props.networkSeed) {
97+ if (props.networkSeed && props.newRevision) {
97− props.setNetworkSeedCache(props.networkSeed)
98+ props.setNetworkSeedCache(props.networkSeed, props.newRevision)
98 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
99 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
99 } else {
100 } else {
100 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
101 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
src/bridge/views/GenKeyfile.js+4−1
@@ -40,7 +40,10 @@ class GenKeyfile extends React.Component {
40 ? pointCache[point]
40 ? pointCache[point]
41 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
41 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
42
42
43+ // in case we did SetKeys earlier this session, make sure to generate the
44+ // newer keyfile, rather than the one that will expire soon
45+ const revision = (this.props.networkRevisionCache ||
43− const revision = parseInt(pointDetails.keyRevisionNumber)
46+ parseInt(pointDetails.keyRevisionNumber));
44
47
45 return {
48 return {
46 point,
49 point,
src/bridge/views/SetKeys.js+1
@@ -210,6 +210,7 @@ class SetKeys extends React.Component {
210 canGenerate={ canGenerate }
210 canGenerate={ canGenerate }
211 createUnsignedTxn={this.createUnsignedTxn}
211 createUnsignedTxn={this.createUnsignedTxn}
212 networkSeed={ state.networkSeed }
212 networkSeed={ state.networkSeed }
213+ newRevision={ (parseInt(pointDetails.keyRevisionNumber) + 1) }
213 setNetworkSeedCache={ props.setNetworkSeedCache } />
214 setNetworkSeedCache={ props.setNetworkSeedCache } />
214
215
215 </Col>
216 </Col>