Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
fefea8fe29
commit
7f29c53c33
|
@ -13,7 +13,7 @@ Option handling
|
||||||
- A new `-anchorconfirmations` argument has been added to allow the user
|
- A new `-anchorconfirmations` argument has been added to allow the user
|
||||||
to specify the number of blocks back from the chain tip that anchors
|
to specify the number of blocks back from the chain tip that anchors
|
||||||
will be selected from when spending notes. By default, anchors will
|
will be selected from when spending notes. By default, anchors will
|
||||||
now be selected at a depth of 10 blocks from the chain tip. Values
|
now be selected to have 10 confirmations. Values
|
||||||
greater than 100 are not supported.
|
greater than 100 are not supported.
|
||||||
|
|
||||||
RPC Interface
|
RPC Interface
|
||||||
|
@ -25,7 +25,9 @@ RPC Interface
|
||||||
when starting the node. If `minconf` is explicitly supplied, it will override
|
when starting the node. If `minconf` is explicitly supplied, it will override
|
||||||
the default value provided by `-anchorconfirmations` if `minconf` specifies
|
the default value provided by `-anchorconfirmations` if `minconf` specifies
|
||||||
a smaller value than the default (it is not possible to spend notes that
|
a smaller value than the default (it is not possible to spend notes that
|
||||||
are more recent than the anchor).
|
are more recent than the anchor). Selecting `minconf` values less than the default
|
||||||
|
is not recommended, as it allows the transaction to be distinguished from transactions
|
||||||
|
using the default for `-anchorconfirmations`.
|
||||||
|
|
||||||
Build system
|
Build system
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -696,7 +696,8 @@ impl Wallet {
|
||||||
/// relative to the specified root of the Orchard note commitment tree.
|
/// relative to the specified root of the Orchard note commitment tree.
|
||||||
///
|
///
|
||||||
/// Returns `None` if the `OutPoint` is not known to the wallet, or the Orchard bundle
|
/// Returns `None` if the `OutPoint` is not known to the wallet, or the Orchard bundle
|
||||||
/// containing the note has not been passed to `Wallet::append_bundle_commitments`.
|
/// containing the note had not been passed to `Wallet::append_bundle_commitments` at
|
||||||
|
/// the specified checkpoint depth.
|
||||||
#[tracing::instrument(level = "trace", skip(self))]
|
#[tracing::instrument(level = "trace", skip(self))]
|
||||||
pub fn get_spend_info(
|
pub fn get_spend_info(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -1043,7 +1043,7 @@ UniValue sendmany(const UniValue& params, bool fHelp)
|
||||||
" \"address\":amount (numeric) The Zcash address is the key, the numeric amount in " + CURRENCY_UNIT + " is the value\n"
|
" \"address\":amount (numeric) The Zcash address is the key, the numeric amount in " + CURRENCY_UNIT + " is the value\n"
|
||||||
" ,...\n"
|
" ,...\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"3. minconf (numeric, optional, default=10) Only use the balance confirmed at least this many times.\n"
|
"3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n"
|
||||||
"4. \"comment\" (string, optional) A comment\n"
|
"4. \"comment\" (string, optional) A comment\n"
|
||||||
"5. subtractfeefromamount (string, optional) A json array with addresses.\n"
|
"5. subtractfeefromamount (string, optional) A json array with addresses.\n"
|
||||||
" The fee will be equally deducted from the amount of each selected address.\n"
|
" The fee will be equally deducted from the amount of each selected address.\n"
|
||||||
|
@ -5137,9 +5137,6 @@ UniValue z_sendmany(const UniValue& params, bool fHelp)
|
||||||
std::optional<uint256> orchardAnchor;
|
std::optional<uint256> orchardAnchor;
|
||||||
auto nAnchorDepth = std::min((unsigned int) nMinDepth, nAnchorConfirmations);
|
auto nAnchorDepth = std::min((unsigned int) nMinDepth, nAnchorConfirmations);
|
||||||
if (!ztxoSelector.SelectsSprout() && nAnchorDepth > 0) {
|
if (!ztxoSelector.SelectsSprout() && nAnchorDepth > 0) {
|
||||||
// Allow Orchard recipients by setting an Orchard anchor.
|
|
||||||
// TODO: Add an orchardAnchorHeight field to ZTXOSelector so we can ensure the
|
|
||||||
// same anchor is used for witnesses of any selected Orchard note.
|
|
||||||
auto orchardAnchorHeight = nextBlockHeight - nAnchorDepth;
|
auto orchardAnchorHeight = nextBlockHeight - nAnchorDepth;
|
||||||
orchardAnchor = chainActive[orchardAnchorHeight]->hashFinalOrchardRoot;
|
orchardAnchor = chainActive[orchardAnchorHeight]->hashFinalOrchardRoot;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue