Remove unused code and formatting
This commit is contained in:
@@ -53,13 +53,13 @@ using namespace libzcash;
|
|||||||
extern UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& mypk);
|
extern UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& mypk);
|
||||||
|
|
||||||
AsyncRPCOperation_mergetoaddress::AsyncRPCOperation_mergetoaddress(
|
AsyncRPCOperation_mergetoaddress::AsyncRPCOperation_mergetoaddress(
|
||||||
boost::optional<TransactionBuilder> builder,
|
boost::optional<TransactionBuilder> builder,
|
||||||
CMutableTransaction contextualTx,
|
CMutableTransaction contextualTx,
|
||||||
std::vector<MergeToAddressInputUTXO> utxoInputs,
|
std::vector<MergeToAddressInputUTXO> utxoInputs,
|
||||||
std::vector<MergeToAddressInputSaplingNote> saplingNoteInputs,
|
std::vector<MergeToAddressInputSaplingNote> saplingNoteInputs,
|
||||||
MergeToAddressRecipient recipient,
|
MergeToAddressRecipient recipient,
|
||||||
CAmount fee,
|
CAmount fee,
|
||||||
UniValue contextInfo) :
|
UniValue contextInfo) :
|
||||||
tx_(contextualTx), utxoInputs_(utxoInputs), saplingNoteInputs_(saplingNoteInputs), recipient_(recipient), fee_(fee), contextinfo_(contextInfo)
|
tx_(contextualTx), utxoInputs_(utxoInputs), saplingNoteInputs_(saplingNoteInputs), recipient_(recipient), fee_(fee), contextinfo_(contextInfo)
|
||||||
{
|
{
|
||||||
if (fee < 0 || fee > MAX_MONEY) {
|
if (fee < 0 || fee > MAX_MONEY) {
|
||||||
@@ -192,22 +192,6 @@ bool AsyncRPCOperation_mergetoaddress::main_impl()
|
|||||||
|
|
||||||
size_t numInputs = utxoInputs_.size();
|
size_t numInputs = utxoInputs_.size();
|
||||||
|
|
||||||
/*
|
|
||||||
// Check mempooltxinputlimit to avoid creating a transaction which the local mempool rejects
|
|
||||||
size_t limit = (size_t)GetArg("-mempooltxinputlimit", 0);
|
|
||||||
{
|
|
||||||
LOCK(cs_main);
|
|
||||||
if (NetworkUpgradeActive(chainActive.Height() + 1, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) {
|
|
||||||
limit = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (limit > 0 && numInputs > limit) {
|
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR,
|
|
||||||
strprintf("Number of transparent inputs %d is greater than mempooltxinputlimit of %d",
|
|
||||||
numInputs, limit));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
CAmount t_inputs_total = 0;
|
CAmount t_inputs_total = 0;
|
||||||
for (MergeToAddressInputUTXO& t : utxoInputs_) {
|
for (MergeToAddressInputUTXO& t : utxoInputs_) {
|
||||||
t_inputs_total += std::get<1>(t);
|
t_inputs_total += std::get<1>(t);
|
||||||
|
|||||||
@@ -205,12 +205,6 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
|
|
||||||
assert(isfromtaddr_ != isfromzaddr_);
|
assert(isfromtaddr_ != isfromzaddr_);
|
||||||
|
|
||||||
/* TODO: this needs to allow DPoW addresses. Consensus-time checks do it correctly.
|
|
||||||
if(t_outputs_.size() > 0) {
|
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Extreme Privacy! You cannot send to a transparent address.");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool isSingleZaddrOutput = (t_outputs_.size()==0 && z_outputs_.size()==1);
|
bool isSingleZaddrOutput = (t_outputs_.size()==0 && z_outputs_.size()==1);
|
||||||
bool isMultipleZaddrOutput = (t_outputs_.size()==0 && z_outputs_.size()>=1);
|
bool isMultipleZaddrOutput = (t_outputs_.size()==0 && z_outputs_.size()>=1);
|
||||||
bool isPureTaddrOnlyTx = (isfromtaddr_ && z_outputs_.size() == 0);
|
bool isPureTaddrOnlyTx = (isfromtaddr_ && z_outputs_.size() == 0);
|
||||||
@@ -319,23 +313,6 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
t_inputs_ = selectedTInputs;
|
t_inputs_ = selectedTInputs;
|
||||||
t_inputs_total = selectedUTXOAmount;
|
t_inputs_total = selectedUTXOAmount;
|
||||||
|
|
||||||
/*
|
|
||||||
// Check mempooltxinputlimit to avoid creating a transaction which the local mempool rejects
|
|
||||||
const size_t limit = (size_t)GetArg("-mempooltxinputlimit", 0);
|
|
||||||
{
|
|
||||||
LOCK(cs_main);
|
|
||||||
if (NetworkUpgradeActive(chainActive.Height() + 1, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) {
|
|
||||||
limit = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (limit > 0) {
|
|
||||||
size_t n = t_inputs_.size();
|
|
||||||
if (n > limit) {
|
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, strprintf("Too many transparent inputs %zu > limit %zu", n, limit));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// update the transaction with these inputs
|
// update the transaction with these inputs
|
||||||
if (isUsingBuilder_) {
|
if (isUsingBuilder_) {
|
||||||
CScript scriptPubKey;
|
CScript scriptPubKey;
|
||||||
@@ -680,6 +657,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
|
|||||||
pwalletMain->GetFilteredNotes(saplingEntries, fromaddress_, mindepth_);
|
pwalletMain->GetFilteredNotes(saplingEntries, fromaddress_, mindepth_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// store sapling inputs so we can correctly lock and unlock them
|
||||||
for (auto entry : saplingEntries) {
|
for (auto entry : saplingEntries) {
|
||||||
z_sapling_inputs_.push_back(entry);
|
z_sapling_inputs_.push_back(entry);
|
||||||
std::string data(entry.memo.begin(), entry.memo.end());
|
std::string data(entry.memo.begin(), entry.memo.end());
|
||||||
|
|||||||
Reference in New Issue
Block a user