diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 05fe037808..a248aa0d05 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3843,6 +3843,13 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt else { //fprintf(stderr,"use notary pubkey\n"); + + // If a valid notary pubkey is passed, the change will be sent to the corresponding address + // as a standard P2PKH vout, not P2PK, so Iguana can easily split it, etc. + vchPubKey = CPubKey(ParseHex(NOTARY_PUBKEY)); + if (vchPubKey.IsValid()) { + scriptChange = GetScriptForDestination(vchPubKey.GetID()); + } else scriptChange = CScript() << ParseHex(NOTARY_PUBKEY) << OP_CHECKSIG; } }