Skip to content
Bitcoin Roots

v30.3-roots.1 · Commit 3: [PATCH 03/68] feat(policy): preserve Roots relay and network controls on Core 30.3

src/test/script_p2sh_tests.cpp

Before: src/test/script_p2sh_tests.cpp · After: src/test/script_p2sh_tests.cpp

File metadata
index b46411185cdf98d7a3569de2e7bc52efc60d17f2..2ac22d79efa121fafe888dadc9f27f107b945177 100644

Download original patch · Release notes

Diff rows 1–32 of 32. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/test/script_p2sh_tests.cpp CHANGED
@@ -3,6 +3,7 @@
3
3
  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
 
5
5
  #include <consensus/tx_verify.h>
6
+ #include <kernel/mempool_options.h>
6
7
  #include <key.h>
7
8
  #include <policy/policy.h>
8
9
  #include <policy/settings.h>
@@ -21,13 +22,22 @@
21
22
  // Helpers:
22
23
  static bool IsStandardTx(const CTransaction& tx, bool permit_bare_multisig, std::string& reason)
23
24
  {
24
- return IsStandardTx(tx, std::nullopt, permit_bare_multisig, CFeeRate{DUST_RELAY_TX_FEE}, reason);
25
+ const kernel::MemPoolOptions opts{
26
+ .permit_bare_pubkey = true,
27
+ .permit_bare_multisig = permit_bare_multisig,
28
+ };
29
+ return IsStandardTx(tx, opts, reason);
25
30
  }
26
31
 
27
32
  static bool IsStandardTx(const CTransaction& tx, std::string& reason)
28
33
  {
29
- return IsStandardTx(tx, std::nullopt, /*permit_bare_multisig=*/true, CFeeRate{DUST_RELAY_TX_FEE}, reason) &&
30
- IsStandardTx(tx, std::nullopt, /*permit_bare_multisig=*/false, CFeeRate{DUST_RELAY_TX_FEE}, reason);
34
+ kernel::MemPoolOptions opts{
35
+ .permit_bare_pubkey = true,
36
+ .permit_bare_multisig = true,
37
+ };
38
+ if (!IsStandardTx(tx, opts, reason)) return false;
39
+ opts.permit_bare_multisig = false;
40
+ return IsStandardTx(tx, opts, reason);
31
41
  }
32
42
 
33
43
  static std::vector<unsigned char> Serialize(const CScript& s)