Skip to content

Commit 4452207

Browse files
committed
Remove commented out code
1 parent c5ba307 commit 4452207

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

src/rpc/blockchain.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,11 +1515,9 @@ UniValue scantxoutset(const JSONRPCRequest& request)
15151515
"Examples of output descriptors are:\n"
15161516
" addr(<address>) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)\n"
15171517
" raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts\n"
1518-
//original BitCoin " combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey\n"
15191518
" combo(<pubkey>) P2PK and P2PKH outputs for the given pubkey\n"
15201519
" pkh(<pubkey>) P2PKH outputs for the given pubkey\n"
15211520
" sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys\n"
1522-
//original BitCoin "\nIn the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one\n"
15231521
"\nIn the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an DRKV/DRKP optionally followed by one\n"
15241522
"or more path elements separated by \"/\", and optionally ending in \"/*\" (unhardened), or \"/*'\" or \"/*h\" (hardened) to specify all\n"
15251523
"unhardened or hardened child keys.\n"
@@ -1644,7 +1642,6 @@ UniValue scantxoutset(const JSONRPCRequest& request)
16441642
UniValue unspent(UniValue::VOBJ);
16451643
unspent.pushKV("txid", outpoint.hash.GetHex());
16461644
unspent.pushKV("vout", (int32_t)outpoint.n);
1647-
//original BitCoin unspent.pushKV("scriptPubKey", HexStr(txo.scriptPubKey.begin(), txo.scriptPubKey.end()));
16481645
unspent.pushKV("scriptPubKey", HexStr(txo.scriptPubKey));
16491646
unspent.pushKV("amount", ValueFromAmount(txo.nValue));
16501647
unspent.pushKV("height", (int32_t)coin.nHeight);

src/script/descriptor.cpp

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include <span.h>
1414
#include <util/system.h>
15-
//#include <util.h> //not PIVX
1615
#include <utilstrencodings.h>
1716

1817
#include <memory>
@@ -232,7 +231,6 @@ class SingleKeyDescriptor final : public Descriptor
232231

233232
CScript P2PKHGetScript(const CPubKey& pubkey) { return GetScriptForDestination(pubkey.GetID()); }
234233
CScript P2PKGetScript(const CPubKey& pubkey) { return GetScriptForRawPubKey(pubkey); }
235-
//CScript P2WPKHGetScript(const CPubKey& pubkey) { return GetScriptForDestination(WitnessV0KeyHash(pubkey.GetID())); } //not PIVX
236234

237235
/** A parsed multi(...) descriptor. */
238236
class MultisigDescriptor : public Descriptor
@@ -323,7 +321,6 @@ class ConvertorDescriptor : public Descriptor
323321
};
324322

325323
CScript ConvertP2SH(const CScript& script) { return GetScriptForDestination(CScriptID(script)); }
326-
//CScript ConvertP2WSH(const CScript& script) { return GetScriptForDestination(WitnessV0ScriptHash(script)); } //not PIVX
327324

328325
/** A parsed combo(P) descriptor. */
329326
class ComboDescriptor final : public Descriptor
@@ -353,14 +350,6 @@ class ComboDescriptor final : public Descriptor
353350
output_scripts = std::vector<CScript>{std::move(p2pk), std::move(p2pkh)};
354351
out.pubkeys.emplace(keyid, key);
355352
}
356-
if (key.IsCompressed()) {
357-
/* CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(keyid)); //not PIVX
358-
CScriptID p2wpkh_id(p2wpkh);
359-
CScript p2sh_p2wpkh = GetScriptForDestination(p2wpkh_id);
360-
out.scripts.emplace(p2wpkh_id, p2wpkh);
361-
output_scripts.push_back(std::move(p2wpkh));
362-
output_scripts.push_back(std::move(p2sh_p2wpkh));*/
363-
}
364353
return true;
365354
}
366355
};
@@ -372,7 +361,6 @@ class ComboDescriptor final : public Descriptor
372361
enum class ParseScriptContext {
373362
TOP,
374363
P2SH,
375-
// P2WSH, //not PIVX
376364
};
377365

378366
/** Parse a constant. If succesful, sp is updated to skip the constant and return true. */
@@ -491,12 +479,12 @@ std::unique_ptr<Descriptor> ParseScript(Span<const char>& sp, ParseScriptContext
491479
{
492480
auto expr = Expr(sp);
493481
if (Func("pk", expr)) {
494-
auto pubkey = ParsePubkey(expr, true/*ctx != ParseScriptContext::P2WSH//not PIVX*/, out);
482+
auto pubkey = ParsePubkey(expr, true, out);
495483
if (!pubkey) return nullptr;
496484
return std::make_unique<SingleKeyDescriptor>(std::move(pubkey), P2PKGetScript, "pk");
497485
}
498486
if (Func("pkh", expr)) {
499-
auto pubkey = ParsePubkey(expr, true/*ctx != ParseScriptContext::P2WSH//not PIVX*/, out);
487+
auto pubkey = ParsePubkey(expr, true, out);
500488
if (!pubkey) return nullptr;
501489
return std::make_unique<SingleKeyDescriptor>(std::move(pubkey), P2PKHGetScript, "pkh");
502490
}
@@ -514,7 +502,7 @@ std::unique_ptr<Descriptor> ParseScript(Span<const char>& sp, ParseScriptContext
514502
while (expr.size()) {
515503
if (!Const(",", expr)) return nullptr;
516504
auto arg = Expr(expr);
517-
auto pk = ParsePubkey(arg, true/*ctx != ParseScriptContext::P2WSH//not PIVX*/, out);
505+
auto pk = ParsePubkey(arg, true, out);
518506
if (!pk) return nullptr;
519507
script_size += pk->GetSize() + 1;
520508
providers.emplace_back(std::move(pk));
@@ -528,21 +516,11 @@ std::unique_ptr<Descriptor> ParseScript(Span<const char>& sp, ParseScriptContext
528516
}
529517
return std::make_unique<MultisigDescriptor>(thres, std::move(providers));
530518
}
531-
/* if (ctx != ParseScriptContext::P2WSH && Func("wpkh", expr)) { //not PIVX
532-
auto pubkey = ParsePubkey(expr, false, out);
533-
if (!pubkey) return nullptr;
534-
return std::make_unique<SingleKeyDescriptor>(std::move(pubkey), P2WPKHGetScript, "wpkh");
535-
}*/
536519
if (ctx == ParseScriptContext::TOP && Func("sh", expr)) {
537520
auto desc = ParseScript(expr, ParseScriptContext::P2SH, out);
538521
if (!desc || expr.size()) return nullptr;
539522
return std::make_unique<ConvertorDescriptor>(std::move(desc), ConvertP2SH, "sh");
540523
}
541-
/* if (ctx != ParseScriptContext::P2WSH && Func("wsh", expr)) { //not PIVX
542-
auto desc = ParseScript(expr, ParseScriptContext::P2WSH, out);
543-
if (!desc || expr.size()) return nullptr;
544-
return std::make_unique<ConvertorDescriptor>(std::move(desc), ConvertP2WSH, "wsh");
545-
}*/
546524
if (ctx == ParseScriptContext::TOP && Func("addr", expr)) {
547525
CTxDestination dest = DecodeDestination(std::string(expr.begin(), expr.end()));
548526
if (!IsValidDestination(dest)) return nullptr;

0 commit comments

Comments
 (0)