1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Merge pull request #15 from newton-blockchain/fine

Fine
This commit is contained in:
Tolya Yanot 2021-02-19 14:55:34 +03:00 committed by GitHub
commit 9409fce537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3678,6 +3678,9 @@ bool compute_punishment(int interval, bool severe, td::RefInt256& fine, unsigned
if (interval <= 1000) {
return false; // no punishments for less than 1000 seconds
}
return true; // todo: (tolya-yanot) temporary reduction of fine
if (severe) {
fine = td::make_refint(2500 * 1000000000LL); // GR$2500
fine_part = (1 << 30); // 1/4 of stake
@ -3699,6 +3702,8 @@ bool compute_punishment(int interval, bool severe, td::RefInt256& fine, unsigned
}
bool check_punishment(int interval, bool severe, td::RefInt256 fine, unsigned fine_part) {
return true; // todo: (tolya-yanot) temporary reduction of fine
td::RefInt256 computed_fine;
unsigned computed_fine_part;
return compute_punishment(interval, severe, computed_fine, computed_fine_part) &&
@ -3730,8 +3735,8 @@ td::Status TestNode::write_val_create_proof(TestNode::ValidatorLoadInfo& info1,
return td::Status::Error("non-positive time interval");
}
int severity = (severe ? 2 : 1);
td::RefInt256 fine = td::make_refint(1000000000);
unsigned fine_part = 0xffffffff / 16; // 1/16
td::RefInt256 fine = td::make_refint(101000000000);
unsigned fine_part = 0; // todo: (tolya-yanot) temporary reduction of fine // 0xffffffff / 16; // 1/16
if (!compute_punishment(interval, severe, fine, fine_part)) {
return td::Status::Error("cannot compute adequate punishment");
}