Skip to content

Commit

Permalink
Merge pull request #15 from HcashOrg/dev
Browse files Browse the repository at this point in the history
fix null address bug
  • Loading branch information
zoowii committed Jan 30, 2018
2 parents 365532a + 9cf15bc commit a88afeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dependence/fc/include/fc/network/http/server.hpp
Expand Up @@ -47,7 +47,7 @@ namespace fc { namespace http {
fc::shared_ptr<impl> my;
};

void listen( const fc::ip::endpoint& p, std::vector<std::string>allow_ips);
void listen( const fc::ip::endpoint& p, std::vector<std::string>allow_ips = std::vector<std::string>());
fc::ip::endpoint get_local_endpoint() const;

/**
Expand Down
7 changes: 6 additions & 1 deletion libraries/blockchain/Address.cpp
Expand Up @@ -8,7 +8,12 @@ namespace hsrcore {
namespace blockchain {


Address::Address(){}
Address::Address(){
fc::ripemd160 temp_ripe;
auto temp_addr = Address(temp_ripe, AddressType::hsr_address);
this->addr = temp_addr.addr;

}

Address::Address(const std::string& base58str, const AddressType& address_type)
{
Expand Down
4 changes: 3 additions & 1 deletion libraries/wallet/TransactionBuilder.cpp
Expand Up @@ -525,13 +525,14 @@ WalletTransactionEntry& TransactionBuilder::sign()
{
try {
const auto chain_id = _wimpl->_blockchain->get_chain_id();

int i = 0;
for (const auto& address : required_signatures)
{
//Ignore exceptions; this function operates on a best-effort basis, and doesn't actually have to succeed.
try {
ilog("@n trying to sign for address ${a}", ("a", address));
trx.sign(_wimpl->self->get_private_key(address), chain_id);
++i;
ilog("@n and I succeeded");
}
catch (const fc::exception& e)
Expand All @@ -544,6 +545,7 @@ WalletTransactionEntry& TransactionBuilder::sign()
{
is_completed = true;
}
FC_ASSERT(i > 0, "Sign failed, Maybe you don't have the priv key which the builder required!");

return transaction_entry;
} FC_CAPTURE_AND_RETHROW()
Expand Down

0 comments on commit a88afeb

Please sign in to comment.