Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pseudo-EA cleanups h/t kallewoof #26

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/policy/policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ bool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs,
return true;
}

size_t HasEphemeralAnchor(const CTransaction& tx)
size_t HasPayToAnchor(const CTransaction& tx)
{
for (const CTxOut& txout : tx.vout) {
if (txout.scriptPubKey.IsPayToAnchor()) {
Expand Down
2 changes: 1 addition & 1 deletion src/policy/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs,
/**
* Check if given transaction has a IsPayToAnchor output.
**/
size_t HasEphemeralAnchor(const CTransaction& tx);
size_t HasPayToAnchor(const CTransaction& tx);

/** Compute the virtual transaction size (weight reinterpreted as bytes). */
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop);
Expand Down
2 changes: 1 addition & 1 deletion src/script/standard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ std::string GetTxnOutputType(TxoutType t)
case TxoutType::SCRIPTHASH: return "scripthash";
case TxoutType::MULTISIG: return "multisig";
case TxoutType::NULL_DATA: return "nulldata";
case TxoutType::ANCHOR: return "true";
case TxoutType::ANCHOR: return "anchor";
case TxoutType::WITNESS_V0_KEYHASH: return "witness_v0_keyhash";
case TxoutType::WITNESS_V0_SCRIPTHASH: return "witness_v0_scripthash";
case TxoutType::WITNESS_V1_TAPROOT: return "witness_v1_taproot";
Expand Down
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
}

// We check for 0-base-fee transaction here now that we have access to ws.m_base_fees.
if (HasEphemeralAnchor(tx) && ws.m_base_fees != 0) {
if (HasPayToAnchor(tx) && ws.m_base_fees != 0) {
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "invalid-ephemeral-fee");
}

Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def run_test(self):
p2wshop2 = script_to_p2wsh_script(op2)
unsolvable_after_importaddress.append(unsolvablep2pkh)
unsolvable_after_importaddress.append(unsolvablep2wshp2pkh)
unsolvable_after_importaddress.append(op2) # OP_1 will be imported as script
unsolvable_after_importaddress.append(op2) # OP_2 will be imported as script
unsolvable_after_importaddress.append(p2wshop2)
unseen_anytime.append(op0) # OP_0 will be imported as P2SH address with no script provided
unsolvable_after_importaddress.append(p2shop0)
Expand Down
2 changes: 1 addition & 1 deletion test/functional/mempool_ephemeral_anchor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Copyright (c) 2023 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down
2 changes: 1 addition & 1 deletion test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def test_psbt_input_keys(psbt_input, keys):
funded_decoded = self.nodes[0].decodepsbt(funded_anchor["psbt"])["tx"]
anchor_idx = 0 if funded_decoded["vout"][0]["scriptPubKey"]["hex"] == "51" else 1
assert_equal(funded_decoded["vout"][anchor_idx]["scriptPubKey"]["hex"], "51")
assert_equal(funded_decoded["vout"][anchor_idx]["scriptPubKey"]["type"], "true")
assert_equal(funded_decoded["vout"][anchor_idx]["scriptPubKey"]["type"], "anchor")
assert_equal(funded_decoded["vout"][anchor_idx]["value"], Decimal("0.00000001"))

anchor_tx = self.nodes[0].finalizepsbt(self.nodes[0].walletprocesspsbt(psbt=funded_anchor["psbt"])["psbt"])["hex"]
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MiniWalletMode(Enum):
mode | description | address | standard | scriptSig | signing
----------------+-------------------+-----------+----------+------------+----------
ADDRESS_OP_TRUE | anyone-can-spend | bech32m | yes | no | no
RAW_OP_2 | anyone-can-spend | - (raw) | no | yes | no
RAW_OP_2 | anyone-can-spend | - (raw) | no | yes | no
RAW_P2PK | pay-to-public-key | - (raw) | yes | yes | yes
"""
ADDRESS_OP_TRUE = 1
Expand Down