aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-tx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r--src/bitcoin-tx.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index 78f5c2c4b6..f1cdc36b72 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -444,9 +444,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 +473,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);