diff options
Diffstat (limited to 'src/bitcoin-tx.cpp')
| -rw-r--r-- | src/bitcoin-tx.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 78f5c2c4b..c82d4f93a 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -4,18 +4,17 @@ #include "base58.h" #include "clientversion.h" -#include "primitives/block.h" // for MAX_BLOCK_SIZE -#include "primitives/transaction.h" -#include "core_io.h" #include "coins.h" +#include "consensus/consensus.h" +#include "core_io.h" #include "keystore.h" +#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 "utilstrencodings.h" #include "utilmoneystr.h" +#include "utilstrencodings.h" #include <stdio.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); |