This commit is contained in:
jl777
2016-11-17 12:29:01 -03:00
parent 44b72fe400
commit 3ec03ada29
3 changed files with 171 additions and 9 deletions

View File

@@ -2627,11 +2627,20 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend,
// Reserve a new key pair from key pool
CPubKey vchPubKey;
bool ret;
ret = reservekey.GetReservedKey(vchPubKey);
assert(ret); // should never fail, as we just unlocked
scriptChange = GetScriptForDestination(vchPubKey.GetID());
extern int32_t USE_EXTERNAL_PUBKEY; extern std::string NOTARY_PUBKEY;
if ( USE_EXTERNAL_PUBKEY == 0 )
{
//fprintf(stderr,"use notary pubkey\n");
//scriptPubKey = CScript() << ParseHex(NOTARY_PUBKEY) << OP_CHECKSIG;
bool ret;
ret = reservekey.GetReservedKey(vchPubKey);
assert(ret); // should never fail, as we just unlocked
scriptChange = GetScriptForDestination(vchPubKey.GetID());
}
else
{
scriptChange = CScript() << ParseHex(NOTARY_PUBKEY) << OP_CHECKSIG;
}
}
CTxOut newTxOut(nChange, scriptChange);