Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release build fix, missing includes #392

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <fc/crypto/base58.hpp>
#include <fc/crypto/sha256.hpp>
#include <graphene/peerplays_sidechain/bitcoin/bitcoin_address.hpp>
#include <graphene/peerplays_sidechain/bitcoin/bitcoin_script.hpp>
#include <graphene/peerplays_sidechain/bitcoin/segwit_addr.hpp>
Expand Down Expand Up @@ -99,7 +100,7 @@ bool bitcoin_address::is_p2pk() const {
parse_hex(address);
return true;
}
} catch (fc::exception e) {
} catch (fc::exception &e) {
return false;
}
return false;
Expand All @@ -121,7 +122,7 @@ bool bitcoin_address::is_p2pkh() const {
return true;
}
return false;
} catch (fc::exception e) {
} catch (fc::exception &e) {
return false;
}
}
Expand All @@ -134,7 +135,7 @@ bool bitcoin_address::is_p2sh() const {
return true;
}
return false;
} catch (fc::exception e) {
} catch (fc::exception &e) {
return false;
}
}
Expand Down Expand Up @@ -269,7 +270,7 @@ void btc_weighted_multisig_address::create_redeem_script(const std::vector<std::

redeem_script_ = builder;

fc::sha256 sh = fc::sha256::hash(redeem_script_);
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
}

Expand Down Expand Up @@ -323,7 +324,7 @@ void btc_one_or_m_of_n_multisig_address::create_redeem_script(const fc::ecc::pub
builder << op::CHECKMULTISIG;
builder << op::ENDIF;
redeem_script_ = builder;
fc::sha256 sh = fc::sha256::hash(redeem_script_);
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
}
void btc_one_or_m_of_n_multisig_address::create_witness_script() {
Expand Down Expand Up @@ -384,7 +385,7 @@ void btc_one_or_weighted_multisig_address::create_redeem_script(const fc::ecc::p
builder << op::GREATERTHANOREQUAL;
builder << op::ENDIF;
redeem_script_ = builder;
fc::sha256 sh = fc::sha256::hash(redeem_script_);
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
}

Expand Down Expand Up @@ -448,7 +449,7 @@ void btc_timelocked_one_or_weighted_multisig_address::create_redeem_script(const
builder << op::GREATERTHANOREQUAL;
builder << op::ENDIF;
redeem_script_ = builder;
fc::sha256 sh = fc::sha256::hash(redeem_script_);
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void peerplays_sidechain_plugin_impl::heartbeat_loop() {
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending heartbeat failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -468,7 +468,7 @@ void peerplays_sidechain_plugin_impl::approve_proposals() {
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending approval failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -544,7 +544,7 @@ void peerplays_sidechain_plugin_impl::create_son_down_proposals() {
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending son down proposal failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -579,7 +579,7 @@ void peerplays_sidechain_plugin_impl::create_son_deregister_proposals() {
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending son deregister proposal failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions libraries/plugins/peerplays_sidechain/sidechain_net_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ bool sidechain_net_handler::approve_proposal(const proposal_id_type &proposal_id
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending approval from ${son_id} for proposal ${proposal_id} failed with exception ${e}",
("son_id", son_id)("proposal_id", proposal_id)("e", e.what()));
return false;
Expand Down Expand Up @@ -205,7 +205,7 @@ void sidechain_net_handler::sidechain_event_data_received(const sidechain_event_
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending son wallet deposit create operation by ${son} failed with exception ${e}", ("son", son_id)("e", e.what()));
}
}
Expand Down Expand Up @@ -247,7 +247,7 @@ void sidechain_net_handler::sidechain_event_data_received(const sidechain_event_
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending son wallet withdraw create operation by ${son} failed with exception ${e}", ("son", son_id)("e", e.what()));
}
}
Expand Down Expand Up @@ -460,7 +460,7 @@ void sidechain_net_handler::process_sidechain_transactions() {
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for sidechain transaction sign operation failed with exception ${e}", ("e", e.what()));
}
});
Expand Down Expand Up @@ -495,7 +495,7 @@ void sidechain_net_handler::send_sidechain_transactions() {
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for sidechain transaction send operation failed with exception ${e}", ("e", e.what()));
}
});
Expand Down Expand Up @@ -560,7 +560,7 @@ void sidechain_net_handler::settle_sidechain_transactions() {
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for sidechain transaction settle operation failed with exception ${e}", ("e", e.what()));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ sidechain_net_handler_bitcoin::sidechain_net_handler_bitcoin(peerplays_sidechain
fc::http::connection conn;
try {
conn.connect_to(fc::ip::endpoint(fc::ip::address(ip), rpc_port));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("No BTC node running at ${ip} or wrong rpc port: ${port}", ("ip", ip)("port", rpc_port));
FC_ASSERT(false);
}
Expand Down Expand Up @@ -1324,7 +1324,7 @@ void sidechain_net_handler_bitcoin::process_primary_wallet() {
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for son wallet update operation failed with exception ${e}", ("e", e.what()));
return;
}
Expand Down Expand Up @@ -1375,7 +1375,7 @@ void sidechain_net_handler_bitcoin::process_sidechain_addresses() {
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for deposit sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -1420,7 +1420,7 @@ bool sidechain_net_handler_bitcoin::process_deposit(const son_wallet_deposit_obj
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for deposit sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -1464,7 +1464,7 @@ bool sidechain_net_handler_bitcoin::process_withdrawal(const son_wallet_withdraw
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for withdraw sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
#include <fc/crypto/hex.hpp>
#include <fc/log/logger.hpp>
#include <fc/network/ip.hpp>
#include <fc/smart_ref_impl.hpp>

#include <graphene/chain/account_object.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp>
#include <graphene/chain/protocol/son_wallet.hpp>
#include <graphene/chain/son_info.hpp>
#include <graphene/chain/son_wallet_object.hpp>
Expand Down Expand Up @@ -149,7 +151,7 @@ void sidechain_net_handler_peerplays::process_sidechain_addresses() {
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending transaction for update deposit address operation failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -203,7 +205,7 @@ bool sidechain_net_handler_peerplays::process_deposit(const son_wallet_deposit_o
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return true;
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sending proposal for deposit sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
return false;
}
Expand Down Expand Up @@ -254,7 +256,7 @@ std::string sidechain_net_handler_peerplays::send_sidechain_transaction(const si
if (plugin.app().p2p_node())
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
return trx.id().str();
} catch (fc::exception e) {
} catch (fc::exception &e) {
elog("Sidechain transaction failed with exception ${e}", ("e", e.what()));
return "";
}
Expand Down