From b78a6b9301f1220472325523b9a22f4c6c5e0063 Mon Sep 17 00:00:00 2001 From: Peter Bushnell Date: Tue, 15 Dec 2020 07:34:52 +0000 Subject: [PATCH] Pass updated coinview copy to RPC check function --- src/masternodes/mn_rpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masternodes/mn_rpc.cpp b/src/masternodes/mn_rpc.cpp index 687b7cd0a0..7f13f48d05 100644 --- a/src/masternodes/mn_rpc.cpp +++ b/src/masternodes/mn_rpc.cpp @@ -3600,7 +3600,7 @@ UniValue sendtokenstoaddress(const JSONRPCRequest& request) { CCoinsViewCache coinview(&::ChainstateActive().CoinsTip()); if (optAuthTx) AddCoins(coinview, *optAuthTx, targetHeight); - const auto res = ApplyAnyAccountsToAccountsTx(mnview_dummy, g_chainstate->CoinsTip(), CTransaction(rawTx), targetHeight, + const auto res = ApplyAnyAccountsToAccountsTx(mnview_dummy, coinview, CTransaction(rawTx), targetHeight, ToByteVector(CDataStream{SER_NETWORK, PROTOCOL_VERSION, msg}), Params().GetConsensus()); if (!res.ok) { if (res.code == CustomTxErrCodes::NotEnoughBalance) {