Transaction signing only by scheduled son

This commit is contained in:
Srdjan Obucina 2020-03-21 07:17:11 +01:00
parent 7abd1c958f
commit 4da8cee3cd
2 changed files with 16 additions and 16 deletions

View file

@ -358,11 +358,9 @@ void peerplays_sidechain_plugin_impl::son_processing() {
current_son_id = son_id;
// Tasks that are executed by all active SONs, no matter if scheduled
// E.g. sending approvals and signing
// E.g. sending approvals and signing (only signing that can be done in parallel)
approve_proposals();
process_sidechain_transactions();
// Tasks that are executed by scheduled and active SON
if (current_son_id == scheduled_son_id) {
@ -376,6 +374,8 @@ void peerplays_sidechain_plugin_impl::son_processing() {
process_withdrawals();
process_sidechain_transactions();
send_sidechain_transactions();
}
} else {

View file

@ -883,19 +883,19 @@ std::string sidechain_net_handler_bitcoin::process_withdrawal(const son_wallet_w
std::string sidechain_net_handler_bitcoin::process_sidechain_transaction(const sidechain_transaction_object &sto, bool &complete) {
//// Uncomment to get signing in order from sto.signers
//son_id_type invalid_signer = son_id_type(0xFFFFFFFF);
//son_id_type next_signer = invalid_signer;
//for (auto &signer : sto.signers) {
// if (signer.second == false) {
// next_signer = signer.first;
// break;
// }
//}
//
//if ((next_signer == invalid_signer) || (next_signer != plugin.get_current_son_id())) {
// return "";
//}
// Uncomment to get signing in order from sto.signers
son_id_type invalid_signer = son_id_type(0xFFFFFFFF);
son_id_type next_signer = invalid_signer;
for (auto &signer : sto.signers) {
if (signer.second == false) {
next_signer = signer.first;
break;
}
}
if ((next_signer == invalid_signer) || (next_signer != plugin.get_current_son_id())) {
return "";
}
return sign_transaction(sto.transaction, complete);
}