Skip to content

Commit 22890a7

Browse files
committed
Adjustments for Ravencoin
1 parent 555ea4f commit 22890a7

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/rpc/assets.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
void CheckRestrictedAssetTransferInputs(const CWalletTx& transaction, const std::string& asset_name) {
4040
// Do a validity check before commiting the transaction
4141
if (IsAssetNameAnRestricted(asset_name)) {
42-
if (pcoinsTip && passets) {
42+
if (pcoinsTip.get() && passets) {
4343
for (auto input : transaction.tx->vin) {
4444
const COutPoint &prevout = input.prevout;
4545
const Coin &coin = pcoinsTip->AccessCoin(prevout);
@@ -1802,7 +1802,7 @@ UniValue getcacheinfo(const JSONRPCRequest& request)
18021802
if (!currentActiveAssetCache)
18031803
throw JSONRPCError(RPC_VERIFY_ERROR, "asset cache is null");
18041804

1805-
if (!pcoinsTip)
1805+
if (!pcoinsTip.get())
18061806
throw JSONRPCError(RPC_VERIFY_ERROR, "coins tip cache is null");
18071807

18081808
if (!passetsCache)

src/rpc/rawtransaction.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ UniValue gettxoutproof(const JSONRPCRequest& request)
271271
} else {
272272
// Loop through txids and try to find which block they're in. Exit loop once a block is found.
273273
for (const auto& tx : setTxids) {
274-
const Coin& coin = AccessByTxid(*pcoinsTip, tx);
274+
const Coin& coin = AccessByTxid(pcoinsTip.get(), tx);
275275
if (!coin.IsSpent()) {
276276
pblockindex = chainActive[coin.nHeight];
277277
break;
@@ -1753,7 +1753,7 @@ UniValue combinerawtransaction(const JSONRPCRequest& request)
17531753
{
17541754
LOCK(cs_main);
17551755
LOCK(mempool.cs);
1756-
CCoinsViewCache &viewChain = *pcoinsTip;
1756+
CCoinsViewCache viewChain(pcoinsTip.get());
17571757
CCoinsViewMemPool viewMempool(&viewChain, mempool);
17581758
view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view
17591759

@@ -1874,7 +1874,7 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
18741874
CCoinsViewCache view(&viewDummy);
18751875
{
18761876
LOCK(mempool.cs);
1877-
CCoinsViewCache &viewChain = *pcoinsTip;
1877+
CCoinsViewCache viewChain(pcoinsTip.get());
18781878
CCoinsViewMemPool viewMempool(&viewChain, mempool);
18791879
view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view
18801880

@@ -2083,7 +2083,7 @@ UniValue sendrawtransaction(const JSONRPCRequest& request)
20832083
if (!request.params[1].isNull() && request.params[1].get_bool())
20842084
nMaxRawTxFee = 0;
20852085

2086-
CCoinsViewCache &view = *pcoinsTip;
2086+
CCoinsViewCache view(pcoinsTip.get());
20872087
bool fHaveChain = false;
20882088
for (size_t o = 0; !fHaveChain && o < tx->vout.size(); o++) {
20892089
const Coin& existingCoin = view.AccessCoin(COutPoint(hashTx, o));

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
984984
if (i != mapTx.end()) {
985985
CValidationState state;
986986
std::vector<std::pair<std::string, uint256>> vReissueAssets;
987-
if (!setAlreadyRemoving.count(hash) && !Consensus::CheckTxAssets(i->GetTx(), state, pcoinsTip, passets, false, vReissueAssets)) {
987+
if (!setAlreadyRemoving.count(hash) && !Consensus::CheckTxAssets(i->GetTx(), state, pcoinsTip.get(), passets, false, vReissueAssets)) {
988988
entries.push_back(&*i);
989989
trans.emplace_back(i->GetTx());
990990
setAlreadyRemoving.insert(hash);

src/validation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3317,7 +3317,6 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
33173317
/** RVN END */
33183318

33193319
{
3320-
CCoinsViewCache view(pcoinsTip);
33213320
/** RVN START */
33223321
// Create the empty asset cache, that will be sent into the connect block
33233322
// All new data will be added to the cache, and will be flushed back into passets after a successful

0 commit comments

Comments
 (0)