mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Merge branch 'testnet' into block-generation
This commit is contained in:
commit
06a6ef2fa9
4 changed files with 76 additions and 23 deletions
|
@ -962,7 +962,12 @@ int output_actions_count(Ref<vm::Cell> list) {
|
|||
int i = -1;
|
||||
do {
|
||||
++i;
|
||||
list = load_cell_slice(std::move(list)).prefetch_ref();
|
||||
bool special = true;
|
||||
auto cs = load_cell_slice_special(std::move(list), special);
|
||||
if (special) {
|
||||
break;
|
||||
}
|
||||
list = cs.prefetch_ref();
|
||||
} while (list.not_null());
|
||||
return i;
|
||||
}
|
||||
|
@ -1079,6 +1084,11 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
|
|||
} else if (in_msg_state.not_null()) {
|
||||
unpack_msg_state(true); // use only libraries
|
||||
}
|
||||
if (in_msg_extern && in_msg_state.not_null() && account.addr != in_msg_state->get_hash().bits()) {
|
||||
LOG(DEBUG) << "in_msg_state hash mismatch in external message";
|
||||
cp.skip_reason = ComputePhase::sk_bad_state;
|
||||
return true;
|
||||
}
|
||||
// initialize VM
|
||||
Ref<vm::Stack> stack = prepare_vm_stack(cp);
|
||||
if (stack.is_null()) {
|
||||
|
@ -1148,7 +1158,8 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
|
|||
int out_act_num = output_actions_count(cp.actions);
|
||||
if (verbosity > 2) {
|
||||
std::cerr << "new smart contract data: ";
|
||||
load_cell_slice(cp.new_data).print_rec(std::cerr);
|
||||
bool can_be_special = true;
|
||||
load_cell_slice_special(cp.new_data, can_be_special).print_rec(std::cerr);
|
||||
std::cerr << "output actions: ";
|
||||
block::gen::OutList{out_act_num}.print_ref(std::cerr, cp.actions);
|
||||
}
|
||||
|
@ -1219,7 +1230,15 @@ bool Transaction::prepare_action_phase(const ActionPhaseConfig& cfg) {
|
|||
int n = 0;
|
||||
while (true) {
|
||||
ap.action_list.push_back(list);
|
||||
auto cs = load_cell_slice(std::move(list));
|
||||
bool special = true;
|
||||
auto cs = load_cell_slice_special(std::move(list), special);
|
||||
if (special) {
|
||||
ap.result_code = 32; // action list invalid
|
||||
ap.result_arg = n;
|
||||
ap.action_list_invalid = true;
|
||||
LOG(DEBUG) << "action list invalid: special cell";
|
||||
return true;
|
||||
}
|
||||
if (!cs.size_ext()) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue