Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <interfaces/wallet.h> | #include <interfaces/wallet.h> | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <chain.h> | #include <chain.h> | ||||
#include <consensus/validation.h> | #include <consensus/validation.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <policy/fees.h> | |||||
#include <policy/policy.h> | #include <policy/policy.h> | ||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <script/ismine.h> | #include <script/ismine.h> | ||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <support/allocators/secure.h> | #include <support/allocators/secure.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <timedata.h> | #include <timedata.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <wallet/fees.h> | |||||
#include <wallet/finaltx.h> | #include <wallet/finaltx.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <memory> | #include <memory> | ||||
namespace interfaces { | namespace interfaces { | ||||
namespace { | namespace { | ||||
▲ Show 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | public: | ||||
[fn](CWallet *, const TxId &txid, ChangeType status) { | [fn](CWallet *, const TxId &txid, ChangeType status) { | ||||
fn(txid, status); | fn(txid, status); | ||||
})); | })); | ||||
} | } | ||||
std::unique_ptr<Handler> | std::unique_ptr<Handler> | ||||
handleWatchOnlyChanged(WatchOnlyChangedFn fn) override { | handleWatchOnlyChanged(WatchOnlyChangedFn fn) override { | ||||
return MakeHandler(m_wallet.NotifyWatchonlyChanged.connect(fn)); | return MakeHandler(m_wallet.NotifyWatchonlyChanged.connect(fn)); | ||||
} | } | ||||
Amount getRequiredFee(unsigned int tx_bytes) override { | |||||
return GetRequiredFee(m_wallet, tx_bytes); | |||||
} | |||||
Amount getMinimumFee(unsigned int tx_bytes, | |||||
const CCoinControl &coin_control) override { | |||||
return GetMinimumFee(m_wallet, tx_bytes, coin_control, g_mempool); | |||||
} | |||||
CWallet &m_wallet; | CWallet &m_wallet; | ||||
}; | }; | ||||
} // namespace | } // namespace | ||||
std::unique_ptr<Wallet> MakeWallet(CWallet &wallet) { | std::unique_ptr<Wallet> MakeWallet(CWallet &wallet) { | ||||
return std::make_unique<WalletImpl>(wallet); | return std::make_unique<WalletImpl>(wallet); | ||||
} | } | ||||
} // namespace interfaces | } // namespace interfaces |