mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated block header
1. Updated block header, proofs now contain more data Notice, that old proofs may become invalid in the future 2. Fixed message routing 3. Fixed block creator id in block header 4. Support for full proofs in tonlib 5. Support for partial state download 6. Some other bugfixes
This commit is contained in:
parent
bce33f588a
commit
13140ddf29
73 changed files with 2084 additions and 304 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <openssl/bn.h>
|
||||
#include "td/utils/bits.h"
|
||||
#include "td/utils/misc.h"
|
||||
|
||||
namespace arith {
|
||||
struct dec_string {
|
||||
|
@ -36,6 +37,12 @@ struct hex_string {
|
|||
explicit hex_string(const std::string& s) : str(s) {
|
||||
}
|
||||
};
|
||||
|
||||
struct bin_string {
|
||||
std::string str;
|
||||
explicit bin_string(const std::string& s) : str(s) {
|
||||
}
|
||||
};
|
||||
} // namespace arith
|
||||
|
||||
namespace arith {
|
||||
|
@ -70,6 +77,10 @@ class Bignum {
|
|||
~Bignum() {
|
||||
BN_free(val);
|
||||
}
|
||||
Bignum(const bin_string& bs) {
|
||||
val = BN_new();
|
||||
set_dec_str(bs.str);
|
||||
}
|
||||
Bignum(const dec_string& ds) {
|
||||
val = BN_new();
|
||||
set_dec_str(ds.str);
|
||||
|
@ -150,6 +161,11 @@ class Bignum {
|
|||
return *this;
|
||||
}
|
||||
|
||||
Bignum& set_raw_bytes(std::string s) {
|
||||
CHECK(BN_bin2bn(reinterpret_cast<const td::uint8*>(s.c_str()), td::narrow_cast<td::uint32>(s.size()), val));
|
||||
return *this;
|
||||
}
|
||||
|
||||
Bignum& set_hex_str(std::string s) {
|
||||
bn_assert(BN_hex2bn(&val, s.c_str()));
|
||||
return *this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue