Replace CReserveKey with ReserveDestinatoin

Instead of reserving keys, reserve destinations which are backed by keys
This commit is contained in:
Andrew Chow
2019-06-18 15:48:20 -04:00
parent 172213be5b
commit 33d13edd2b
6 changed files with 73 additions and 74 deletions

View File

@@ -363,17 +363,17 @@ public:
CWalletTx& AddTx(CRecipient recipient)
{
CTransactionRef tx;
CReserveKey reservekey(wallet.get());
ReserveDestination reservedest(wallet.get());
CAmount fee;
int changePos = -1;
std::string error;
CCoinControl dummy;
{
auto locked_chain = m_chain->lock();
BOOST_CHECK(wallet->CreateTransaction(*locked_chain, {recipient}, tx, reservekey, fee, changePos, error, dummy));
BOOST_CHECK(wallet->CreateTransaction(*locked_chain, {recipient}, tx, reservedest, fee, changePos, error, dummy));
}
CValidationState state;
BOOST_CHECK(wallet->CommitTransaction(tx, {}, {}, reservekey, state));
BOOST_CHECK(wallet->CommitTransaction(tx, {}, {}, reservedest, state));
CMutableTransaction blocktx;
{
LOCK(wallet->cs_wallet);