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

updated smartcontract code

updated lite-client and configuration smartcontract
updated tonlib code
This commit is contained in:
ton 2019-09-16 12:06:04 +04:00
parent 8e5bd938aa
commit bce33f588a
46 changed files with 677 additions and 299 deletions

View file

@ -296,7 +296,10 @@ td::Result<TransactionList::Info> TransactionList::validate() const {
return std::move(res);
}
td::Status BlockProofLink::validate() const {
td::Status BlockProofLink::validate(td::uint32* save_utime) const {
if (save_utime) {
*save_utime = 0;
}
if (!(from.is_masterchain_ext() && to.is_masterchain_ext())) {
return td::Status::Error("BlockProofLink must have both source and destination blocks in the masterchain");
}
@ -346,6 +349,9 @@ td::Status BlockProofLink::validate() const {
return td::Status::Error(PSTRING() << "incorrect is_key_block value " << is_key << " for destination block "
<< to.to_str());
}
if (save_utime) {
*save_utime = info.gen_utime;
}
} else if (!is_key) {
// return td::Status::Error("Zerostate destination block "s + to.to_str() + " does not have is_key_block set");
}
@ -414,6 +420,8 @@ td::Status BlockProofLink::validate() const {
td::Status BlockProofChain::validate() {
valid = false;
has_key_block = false;
has_utime = false;
last_utime = 0;
key_blkid.invalidate();
if (!(from.is_masterchain_ext() && to.is_masterchain_ext())) {
return td::Status::Error("BlockProofChain must have both source and destination blocks in the masterchain");
@ -435,7 +443,7 @@ td::Status BlockProofChain::validate() {
<< link.from.to_str() << " but the previous link ends at different block "
<< cur.to_str());
}
auto err = link.validate();
auto err = link.validate(&last_utime);
if (err.is_error()) {
return td::Status::Error(PSTRING() << "link #" << i << " in BlockProofChain is invalid: " << err.to_string());
}
@ -449,6 +457,7 @@ td::Status BlockProofChain::validate() {
return td::Status::Error("last link of BlockProofChain ends at block "s + cur.to_str() +
" different from declared chain destination block " + to.to_str());
}
has_utime = (last_utime > 0);
valid = true;
return td::Status::OK();
}