diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-05-06 11:39:13 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-05-06 12:29:07 +0200 |
| commit | 12f348825394d5a25145b380267641688cd5d51f (patch) | |
| tree | c1c313b19c1d47dcbd9dec5a0bdd9d6f8cde979e /src/bitcoin-tx.cpp | |
| parent | Merge pull request #6055 (diff) | |
| parent | Update key.cpp to use new libsecp256k1 (diff) | |
| download | discoin-12f348825394d5a25145b380267641688cd5d51f.tar.xz discoin-12f348825394d5a25145b380267641688cd5d51f.zip | |
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.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index d024b4802..c82d4f93a 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); |