@@ -40,8 +40,6 @@ extern RPCHelpMan getrawchangeaddress();
40
40
extern RPCHelpMan getaddressinfo ();
41
41
extern RPCHelpMan addmultisigaddress ();
42
42
43
- extern RecursiveMutex cs_wallets;
44
-
45
43
// Ensure that fee levels defined in the wallet are at least as high
46
44
// as the default levels for node policy.
47
45
static_assert (DEFAULT_TRANSACTION_MINFEE >= DEFAULT_MIN_RELAY_TX_FEE, " wallet minimum fee is smaller than default relay fee" );
@@ -605,12 +603,7 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
605
603
606
604
BOOST_FIXTURE_TEST_CASE (wallet_disableprivkeys, TestChain100Setup)
607
605
{
608
- NodeContext node;
609
- node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
610
- node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator .get ());
611
- auto chain = interfaces::MakeChain (node);
612
- const std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(chain.get (), m_node.coinjoin_loader .get (), " " , CreateDummyWalletDatabase ());
613
- wallet->SetupLegacyScriptPubKeyMan ();
606
+ const std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(m_node.chain .get (), m_node.coinjoin_loader .get (), " " , CreateDummyWalletDatabase ()); wallet->SetupLegacyScriptPubKeyMan ();
614
607
wallet->SetMinVersion (FEATURE_LATEST);
615
608
wallet->SetWalletFlag (WALLET_FLAG_DISABLE_PRIVATE_KEYS);
616
609
BOOST_CHECK (!wallet->TopUpKeyPool (1000 ));
@@ -637,19 +630,15 @@ static size_t CalculateNestedKeyhashInputSize(bool use_max_sig)
637
630
// Create outer P2SH script for the output
638
631
CScript script_pubkey = GetScriptForRawPubKey (pubkey);
639
632
640
- NodeContext node;
641
- node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
642
- node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator .get ());
643
- auto chain = interfaces::MakeChain (node);
644
- CWallet wallet (chain.get (), /* coinjoin_loader=*/ nullptr , " " , CreateDummyWalletDatabase ());
645
- AddKey (wallet, key);
646
- auto spk_man = wallet.GetLegacyScriptPubKeyMan ();
647
- spk_man->AddCScript (inner_script);
633
+ // Add inner-script to key store and key to watchonly
634
+ FillableSigningProvider keystore;
635
+ keystore.AddCScript (inner_script);
636
+ keystore.AddKeyPubKey (key, pubkey);
648
637
649
638
// Fill in dummy signatures for fee calculation.
650
639
SignatureData sig_data;
651
640
652
- if (!ProduceSignature (*spk_man , use_max_sig ? DUMMY_MAXIMUM_SIGNATURE_CREATOR : DUMMY_SIGNATURE_CREATOR, script_pubkey, sig_data)) {
641
+ if (!ProduceSignature (keystore , use_max_sig ? DUMMY_MAXIMUM_SIGNATURE_CREATOR : DUMMY_SIGNATURE_CREATOR, script_pubkey, sig_data)) {
653
642
// We're hand-feeding it correct arguments; shouldn't happen
654
643
assert (false );
655
644
}
@@ -805,7 +794,6 @@ BOOST_FIXTURE_TEST_CASE(CreateWalletWithoutChain, BasicTestingSetup)
805
794
BOOST_FIXTURE_TEST_CASE (ZapSelectTx, TestChain100Setup)
806
795
{
807
796
gArgs .ForceSetArg (" -unsafesqlitesync" , " 1" );
808
- auto chain = interfaces::MakeChain (m_node);
809
797
auto wallet = TestLoadWallet (m_node.chain .get (), m_node.coinjoin_loader .get ());
810
798
CKey key;
811
799
key.MakeNewKey (true );
0 commit comments