mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge pull request #6047
a56054bUpdate key.cpp to use new libsecp256k1 (Pieter Wuille)a591d98Squashed 'src/secp256k1/' changes from 1897b8e..22f60a6 (Pieter Wuille)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user