aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-tx.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-05-06 11:39:13 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-05-06 12:29:07 +0200
commit12f348825394d5a25145b380267641688cd5d51f (patch)
treec1c313b19c1d47dcbd9dec5a0bdd9d6f8cde979e /src/bitcoin-tx.cpp
parent00820f921d8fcaa031e561ee641c50e77a909670 (diff)
parenta56054be650052361e8de79f0f03a56a043759e5 (diff)
Merge pull request #6047
a56054b Update key.cpp to use new libsecp256k1 (Pieter Wuille) a591d98 Squashed 'src/secp256k1/' changes from 1897b8e..22f60a6 (Pieter Wuille)
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 d024b48020..c82d4f93a8 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -442,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")
@@ -462,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);