提交 eb06b93c 编写于 作者: K Kevin Heifner 提交者: Matt Witherspoon

Merge pull request #971 from PaulCalabrese/STAT-306-GH970-Replay-Assertion

STAT-306 #970 Replay causes assertion

(reapplied on noon branch)
上级 f626d422
......@@ -236,6 +236,8 @@ void apply_eosio_setcode(apply_context& context) {
/** TODO: consider whether a microsecond level local timestamp is sufficient to detect code version changes*/
#warning TODO: update setcode message to include the hash, then validate it in validate
a.code_version = code_id;
// Added resize(0) here to avoid bug in boost vector container
a.code.resize( 0 );
a.code.resize( act.code.size() );
memcpy( a.code.data(), act.code.data(), act.code.size() );
......
......@@ -26,6 +26,8 @@ namespace eosio { namespace chain {
shared_vector<char> abi;
void set_abi( const eosio::chain::contracts::abi_def& a ) {
// Added resize(0) here to avoid bug in boost vector container
abi.resize( 0 );
abi.resize( fc::raw::pack_size( a ) );
fc::datastream<char*> ds( abi.data(), abi.size() );
fc::raw::pack( ds, a );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册