Skip to content

Commit f16179d

Browse files
authored
Merge branch 'dev' into feature/inline-tx-id
2 parents 69ec7e8 + 6ea81f8 commit f16179d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/AElf.WebApp.Application.Chain/Services/TransactionResultAppService.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,16 @@ await _transactionResultProxyService.InvalidTransactionResultService.GetInvalidT
119119
}
120120
}
121121

122+
var chain = await _blockchainService.GetChainAsync();
123+
if (chain.BestChainHeight - output.Transaction.RefBlockNumber > KernelConstants.ReferenceBlockValidPeriod
124+
&& transactionResult.Status == TransactionResultStatus.NotExisted)
125+
{
126+
// set a the Error message to the output to infer that the transaction will never succeed.
127+
var error = "The transaction is already expired, and it will never succeed.";
128+
output.Error = TransactionErrorResolver.TakeErrorMessage(error, _webAppOptions.IsDebugMode);
129+
return output;
130+
}
122131
return output;
123-
124132
}
125133

126134
/// <summary>

0 commit comments

Comments
 (0)