Skip to content

Commit c0ca93c

Browse files
Merge dashpay#6340: fix: make 6336 compile in v21.1.x branch, using older CHECK_NONFATAL functionality
a7bbcc8 fix: make 6336 compile in v21.1.x branch, using older CHECK_NONFATAL functionality (pasta) Pull request description: ## Issue being fixed or feature implemented Resolve build failures when 6336 is back ported ## What was done? Use older functionality of CHECK_NONFATAL ## How Has This Been Tested? built on both branches ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: knst: utACK a7bbcc8 UdjinM6: utACK a7bbcc8 (dashpay#6339 compiles with this one applied on top of it) kwvg: utACK a7bbcc8 Tree-SHA512: 17b6d8223f653eaafa6ef9d1a4e8fc14ca1fe1623fbb13d23a9429e87a64c8fae3ddaf6d2d8d5a52138ab712a36949662b38a8a9cbbc5db3618ce24f565f6f2a
1 parent bb96df4 commit c0ca93c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/core_write.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, bool include_add
336336
if (calculate_fee) {
337337
CAmount fee = amt_total_in - amt_total_out;
338338
if (tx.IsPlatformTransfer()) {
339-
fee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(tx))->getFee();
339+
auto payload = GetTxPayload<CAssetUnlockPayload>(tx);
340+
CHECK_NONFATAL(payload);
341+
fee = payload->getFee();
340342
}
341343
CHECK_NONFATAL(MoneyRange(fee));
342344
entry.pushKV("fee", ValueFromAmount(fee));

src/rpc/blockchain.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,9 @@ static RPCHelpMan getblockstats()
24262426
CAmount txfee = tx_total_in - tx_total_out;
24272427

24282428
if (tx->IsPlatformTransfer()) {
2429-
txfee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee();
2429+
auto payload = GetTxPayload<CAssetUnlockPayload>(*tx);
2430+
CHECK_NONFATAL(payload);
2431+
txfee = payload->getFee();
24302432
}
24312433

24322434
CHECK_NONFATAL(MoneyRange(txfee));

src/rpc/masternode.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ static RPCHelpMan masternode_payments()
411411
continue;
412412
}
413413
if (tx->IsPlatformTransfer()) {
414-
nBlockFees += CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee();
414+
auto payload = GetTxPayload<CAssetUnlockPayload>(*tx);
415+
CHECK_NONFATAL(payload);
416+
nBlockFees += payload->getFee();
415417
continue;
416418
}
417419

0 commit comments

Comments
 (0)