mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-03-02 09:06:01 +00:00
Merge pull request #187 from dooglus/change-1.5
Allow a fixed list of change addresses.
This commit is contained in:
commit
35345478bc
@ -1248,6 +1248,19 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend,
|
||||
if (coinControl && !boost::get<CNoDestination>(&coinControl->destChange))
|
||||
scriptChange.SetDestination(coinControl->destChange);
|
||||
|
||||
// send change to one of the specified change addresses
|
||||
else if (mapArgs.count("-change") && mapMultiArgs["-change"].size() > 0)
|
||||
{
|
||||
CBitcoinAddress address(mapMultiArgs["-change"][GetRandInt(mapMultiArgs["-change"].size())]);
|
||||
|
||||
CKeyID keyID;
|
||||
if (!address.GetKeyID(keyID)) {
|
||||
strFailReason = _("Bad change address");
|
||||
return false;
|
||||
}
|
||||
|
||||
scriptChange.SetDestination(keyID);
|
||||
}
|
||||
// no coin control: send change to newly generated address
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user