Fix: do_evaluate method incorrect witness
This commit is contained in:
parent
22826fd680
commit
4a20369013
3 changed files with 7 additions and 2 deletions
|
|
@ -116,8 +116,7 @@ void_result bitcoin_transaction_sign_evaluator::do_evaluate( const bitcoin_trans
|
||||||
const auto& proposal_itr = proposal_idx.find( op.proposal_id );
|
const auto& proposal_itr = proposal_idx.find( op.proposal_id );
|
||||||
FC_ASSERT( proposal_idx.end() != proposal_itr, "proposal not found");
|
FC_ASSERT( proposal_idx.end() != proposal_itr, "proposal not found");
|
||||||
|
|
||||||
witness_id_type scheduled_witness = d.get_scheduled_witness( 1 );
|
const auto& witness_obj = d.get< witness_object >( d._current_witness_id );
|
||||||
const auto& witness_obj = d.get< witness_object >( scheduled_witness );
|
|
||||||
FC_ASSERT( witness_obj.witness_account == op.payer, "Incorrect witness." );
|
FC_ASSERT( witness_obj.witness_account == op.payer, "Incorrect witness." );
|
||||||
|
|
||||||
sidechain::bytes public_key( public_key_data_to_bytes( witness_obj.signing_key.key_data ) );
|
sidechain::bytes public_key( public_key_data_to_bytes( witness_obj.signing_key.key_data ) );
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,8 @@ signed_block database::_generate_block(
|
||||||
|
|
||||||
send_btc_tx_flag = false;
|
send_btc_tx_flag = false;
|
||||||
|
|
||||||
|
_current_witness_id = witness_obj.id;
|
||||||
|
|
||||||
uint64_t postponed_tx_count = 0;
|
uint64_t postponed_tx_count = 0;
|
||||||
// pop pending state (reset to head block state)
|
// pop pending state (reset to head block state)
|
||||||
for( const processed_transaction& tx : _pending_tx )
|
for( const processed_transaction& tx : _pending_tx )
|
||||||
|
|
@ -587,6 +589,8 @@ void database::apply_block( const signed_block& next_block, uint32_t skip )
|
||||||
skip = ~0;// WE CAN SKIP ALMOST EVERYTHING
|
skip = ~0;// WE CAN SKIP ALMOST EVERYTHING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_current_witness_id = next_block.witness;
|
||||||
|
|
||||||
detail::with_skip_flags( *this, skip, [&]()
|
detail::with_skip_flags( *this, skip, [&]()
|
||||||
{
|
{
|
||||||
_apply_block( next_block );
|
_apply_block( next_block );
|
||||||
|
|
|
||||||
|
|
@ -570,6 +570,8 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
bool send_btc_tx_flag = true;
|
bool send_btc_tx_flag = true;
|
||||||
|
|
||||||
|
witness_id_type _current_witness_id;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void restore_bitcoin_transaction_status(); // db_sidechain
|
void restore_bitcoin_transaction_status(); // db_sidechain
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue