Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a limit to CSV opcode in the script builder #141

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Op>
Expand Down
Loading