aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-tx.cpp
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2024-05-07 08:55:34 -0400
committerTheCharlatan <seb.kung@gmail.com>2024-05-09 15:56:06 +0200
commita08d2b3cb971c68e9a50b991b2953fa4541cf48a (patch)
tree781c317afdaf72d0729dbfac8873e9d2cd22a6fc /src/bitcoin-tx.cpp
parent28905c1a64a87a56f16aea8a4d23dea7eec9ca59 (diff)
downloadbitcoin-a08d2b3cb971c68e9a50b991b2953fa4541cf48a.tar.xz
tools: Use ECC_Context helper in bitcoin-tx and bitcoin-wallet tools
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r--src/bitcoin-tx.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index 1c5b0c074c..cfac50e090 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -692,21 +692,10 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
tx = mergedTx;
}
-class Secp256k1Init
-{
-public:
- Secp256k1Init() {
- ECC_Start();
- }
- ~Secp256k1Init() {
- ECC_Stop();
- }
-};
-
static void MutateTx(CMutableTransaction& tx, const std::string& command,
const std::string& commandVal)
{
- std::unique_ptr<Secp256k1Init> ecc;
+ std::unique_ptr<ECC_Context> ecc;
if (command == "nversion")
MutateTxVersion(tx, commandVal);
@@ -726,10 +715,10 @@ static void MutateTx(CMutableTransaction& tx, const std::string& command,
else if (command == "outaddr")
MutateTxAddOutAddr(tx, commandVal);
else if (command == "outpubkey") {
- ecc.reset(new Secp256k1Init());
+ ecc.reset(new ECC_Context());
MutateTxAddOutPubKey(tx, commandVal);
} else if (command == "outmultisig") {
- ecc.reset(new Secp256k1Init());
+ ecc.reset(new ECC_Context());
MutateTxAddOutMultiSig(tx, commandVal);
} else if (command == "outscript")
MutateTxAddOutScript(tx, commandVal);
@@ -737,7 +726,7 @@ static void MutateTx(CMutableTransaction& tx, const std::string& command,
MutateTxAddOutData(tx, commandVal);
else if (command == "sign") {
- ecc.reset(new Secp256k1Init());
+ ecc.reset(new ECC_Context());
MutateTxSign(tx, commandVal);
}