diff --git a/src/omnicore/encoding.cpp b/src/omnicore/encoding.cpp index fb45b780f0eb5..3764dc1802ae8 100644 --- a/src/omnicore/encoding.cpp +++ b/src/omnicore/encoding.cpp @@ -23,7 +23,7 @@ * https://github.com/mastercoin-MSC/spec#class-b-transactions-also-known-as-the-multisig-method */ bool OmniCore_Encode_ClassB(const std::string& senderAddress, const CPubKey& redeemingPubKey, - const std::vector& vchPayload, std::vector >& vecOutputs) + const std::vector& vchPayload, std::vector >& vecOutputs, CAmount *outputAmount) { unsigned int nRemainingBytes = vchPayload.size(); unsigned int nNextByte = 0; @@ -65,11 +65,15 @@ bool OmniCore_Encode_ClassB(const std::string& senderAddress, const CPubKey& red // Push back a bare multisig output with obfuscated data CScript scriptMultisigOut = GetScriptForMultisig(1, vKeys); + if (outputAmount) + *outputAmount += OmniGetDustThreshold(scriptMultisigOut); vecOutputs.push_back(std::make_pair(scriptMultisigOut, OmniGetDustThreshold(scriptMultisigOut))); } // Add the Exodus marker output CScript scriptExodusOutput = GetScriptForDestination(ExodusAddress()); + if (outputAmount) + *outputAmount += OmniGetDustThreshold(scriptExodusOutput); vecOutputs.push_back(std::make_pair(scriptExodusOutput, OmniGetDustThreshold(scriptExodusOutput))); return true; } diff --git a/src/omnicore/encoding.h b/src/omnicore/encoding.h index a894a66e84756..a87d6dd11b0f4 100644 --- a/src/omnicore/encoding.h +++ b/src/omnicore/encoding.h @@ -4,6 +4,7 @@ class CPubKey; class CTxOut; +#include #include