Skip to content
Bitcoin Roots

v29.4-roots.4 · Commit 3: [PATCH 03/37] policy: restore conservative relay and network controls

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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

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