Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 100c3ef

Browse files
committed
adjust tx expiration
1 parent 924d2ca commit 100c3ef

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/renderer/components/TxActivityItem.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const timeAgo = TimeAgo()
8383
export default class TxActivityItem extends Vue {
8484
@Prop(Object) item !: entities.Activity<'tx'>
8585
86-
resendCount = 0
86+
resendTime: { [id: string]: number } = {}
8787
8888
get txObject() { return Transaction.decode(Buffer.from(this.item.data.raw.slice(2), 'hex')) }
8989
get comment() { return this.item.data.comment || describeClauses(this.item.data.message) }
@@ -110,7 +110,6 @@ export default class TxActivityItem extends Vue {
110110
}
111111
112112
get status() {
113-
this.resendCount
114113
this.$store.state.syncStatus // pulse
115114
const headTs = this.$store.state.chainHead.timestamp as number
116115
if (this.item.data.receipt) {
@@ -127,7 +126,8 @@ export default class TxActivityItem extends Vue {
127126
return 'error'
128127
}
129128
130-
if (qStatus === 'sent' && headTs > this.item.data.timestamp + 10 * 60) {
129+
const sendTime = this.resendTime[this.item.data.id] || this.item.data.timestamp
130+
if (qStatus === 'sent' && headTs > sendTime + 10 * 6) {
131131
return 'timeout'
132132
}
133133
@@ -169,7 +169,7 @@ export default class TxActivityItem extends Vue {
169169
170170
resend() {
171171
CLIENT.txer.send(this.item.data.id, this.item.data.raw)
172-
this.resendCount++
172+
this.$set(this.resendTime, this.item.data.id, Date.now() / 1000)
173173
}
174174
175175
reveal() {

src/renderer/tx-tracker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async function handleTx(txRow: entities.Activity<'tx'>, dispose: () => void) {
77
try {
88
const receipt = await connex.thor.transaction(txRow.data.id).getReceipt()
99
const confirmed = receipt ? head.number - receipt.meta.blockNumber >= 12 : false
10-
const expired = !receipt && (head.timestamp - txRow.data.timestamp > 3600 * 2)
10+
const expired = !receipt && (head.timestamp - txRow.data.timestamp > 18 * 10 + 10)
1111
await BDB.activities
1212
.where({ id: txRow.id! })
1313
.modify(row => {

src/renderer/tx-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function buildTx(
7979
const tx = new Transaction({
8080
chainTag: Number.parseInt(genesis.id.slice(genesis.id.length - 2), 16),
8181
blockRef: bestId.slice(0, 18),
82-
expiration: 720,
82+
expiration: 18, // about 3 mins
8383
clauses,
8484
gasPriceCoef,
8585
gas,

0 commit comments

Comments
 (0)