diff options
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r-- | src/bitcoin-tx.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index f1c1c0ff8b..c82d4f93a8 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -11,7 +11,6 @@ #include "primitives/transaction.h" #include "script/script.h" #include "script/sign.h" -#include "ui_interface.h" // for _(...) #include "univalue/univalue.h" #include "util.h" #include "utilmoneystr.h" @@ -26,7 +25,6 @@ using namespace std; static bool fCreateBlank; static map<string,UniValue> registers; -CClientUIInterface uiInterface; static bool AppInitRawTx(int argc, char* argv[]) { @@ -444,9 +442,18 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) tx = mergedTx; } +class Secp256k1Init +{ +public: + Secp256k1Init() { ECC_Start(); } + ~Secp256k1Init() { ECC_Stop(); } +}; + static void MutateTx(CMutableTransaction& tx, const string& command, const string& commandVal) { + boost::scoped_ptr<Secp256k1Init> ecc; + if (command == "nversion") MutateTxVersion(tx, commandVal); else if (command == "locktime") @@ -464,8 +471,10 @@ static void MutateTx(CMutableTransaction& tx, const string& command, else if (command == "outscript") MutateTxAddOutScript(tx, commandVal); - else if (command == "sign") + else if (command == "sign") { + if (!ecc) { ecc.reset(new Secp256k1Init()); } MutateTxSign(tx, commandVal); + } else if (command == "load") RegisterLoad(commandVal); |