diff --git a/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs b/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs index a24f11c5..927f03c0 100644 --- a/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs +++ b/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs @@ -15,6 +15,13 @@ public InvestmentScriptBuilder(ISeederScriptTreeBuilder seederScriptTreeBuilder) public Script GetInvestorPenaltyTransactionScript(string investorKey, int punishmentLockDays) { + if (punishmentLockDays > 388) + { + // the actual number is 65535*512 seconds (388 days) + // https://en.bitcoin.it/wiki/Timelock + throw new ArgumentOutOfRangeException(nameof(punishmentLockDays), $"Invalid CSV value {punishmentLockDays}"); + } + var sequence = new Sequence(TimeSpan.FromDays(punishmentLockDays)); return new(new List