diff options
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r-- | src/bitcoin-tx.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 1e27d400c8..b6e7a6c540 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -3,23 +3,24 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" -#include "util.h" -#include "utilmoneystr.h" #include "core.h" -#include "main.h" // for MAX_BLOCK_SIZE +#include "core_io.h" #include "keystore.h" +#include "main.h" // for MAX_BLOCK_SIZE #include "script/script.h" #include "script/sign.h" #include "ui_interface.h" // for _(...) #include "univalue/univalue.h" -#include "core_io.h" +#include "util.h" +#include "utilmoneystr.h" #include <stdio.h> -#include <boost/assign/list_of.hpp> + #include <boost/algorithm/string.hpp> +#include <boost/assign/list_of.hpp> -using namespace std; using namespace boost::assign; +using namespace std; static bool fCreateBlank; static map<string,UniValue> registers; @@ -223,9 +224,8 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const string& strInput) if (!addr.IsValid()) throw runtime_error("invalid TX output address"); - // build standard output script via SetDestination() - CScript scriptPubKey; - scriptPubKey.SetDestination(addr.Get()); + // build standard output script via GetScriptForDestination() + CScript scriptPubKey = GetScriptForDestination(addr.Get()); // construct TxOut, append to transaction output list CTxOut txout(value, scriptPubKey); @@ -237,8 +237,7 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const string& strInput // separate VALUE:SCRIPT in string size_t pos = strInput.find(':'); if ((pos == string::npos) || - (pos == 0) || - (pos == (strInput.size() - 1))) + (pos == 0)) throw runtime_error("TX output missing separator"); // extract and validate VALUE |