From 92a3aed32175c43360ac0439f95fe26605b891b8 Mon Sep 17 00:00:00 2001 From: PBSA Github Manager Date: Sun, 28 May 2017 01:57:03 -0300 Subject: [PATCH] fixed update witness operation - added new_initial_secret --- libraries/wallet/wallet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 48675cd0..728e0c12 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -1753,6 +1753,7 @@ public: fc::raw::pack(enc, secret_hash_type()); witness_create_op.initial_secret = secret_hash_type::hash(enc.result()); + if (_remote_db->get_witness_by_account(witness_create_op.witness_account)) FC_THROW("Account ${owner_account} is already a witness", ("owner_account", owner_account)); @@ -1780,9 +1781,10 @@ public: witness_update_op.witness_account = witness_account.id; if( url != "" ) witness_update_op.new_url = url; - if( block_signing_key != "" ) + if( block_signing_key != "" ) { witness_update_op.new_signing_key = public_key_type( block_signing_key ); - + witness_update_op.new_initial_secret = secret_hash_type::hash(secret_hash_type()); + } signed_transaction tx; tx.operations.push_back( witness_update_op ); set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees );