Merge pull request #15 from DeathRay1977/master

Perfect, thanks!
This commit is contained in:
Darkcoin 2014-07-01 13:17:41 -07:00
commit 212015e2e0
3 changed files with 36 additions and 3 deletions

View File

@ -5840,12 +5840,15 @@ public:
*/
void CDarkSendPool::SetCollateralAddress(std::string strAddress){
bool CDarkSendPool::SetCollateralAddress(std::string strAddress){
CBitcoinAddress address;
if (!address.SetString(strAddress))
{
printf("CDarkSendPool::SetCollateralAddress - Invalid DarkSend collateral address\n");
return false;
}
collateralPubKey.SetDestination(address.Get());
return true;
}
//Get last block hash

View File

@ -2516,7 +2516,7 @@ public:
SetCollateralAddress(strAddress);
}
void SetCollateralAddress(std::string strAddress);
bool SetCollateralAddress(std::string strAddress);
bool GetLastValidBlockHash(uint256& hash, int mod=10);
int GetCurrentMasterNode(int mod=10);
void NewBlock();

View File

@ -27,6 +27,36 @@ BOOST_AUTO_TEST_CASE(darksend_sign)
}
BOOST_AUTO_TEST_CASE(set_collateral_address_bad)
{
CDarkSendPool * dsp_ptr = new CDarkSendPool();
string crappy = "badaddress";
BOOST_CHECK( dsp_ptr->SetCollateralAddress(crappy) == false );
delete dsp_ptr;
}
BOOST_AUTO_TEST_CASE(set_collateral_address_production)
{
CDarkSendPool * dsp_ptr = new CDarkSendPool();
string prod = "Xq19GqFvajRrEdDHYRKGYjTsQfpV5jyipF";
BOOST_CHECK( dsp_ptr->SetCollateralAddress(prod) == true );
delete dsp_ptr;
}
BOOST_AUTO_TEST_CASE(set_collateral_address_testnet)
{
CDarkSendPool * dsp_ptr = new CDarkSendPool();
string testnet = "mxE2Rp3oYpSEFdsN5TdHWhZvEHm3PJQQVm";
BOOST_CHECK( dsp_ptr->SetCollateralAddress(testnet) == true );
delete dsp_ptr;
}
BOOST_AUTO_TEST_CASE(darksend_vote)
{