@@ -955,35 +955,30 @@ static RPCHelpMan testmempoolaccept()
955
955
nullptr /* plTxnReplaced */ , false /* bypass_limits */ , /* test_accept */ true , &fee);
956
956
}
957
957
958
- // Check that fee does not exceed maximum fee
959
- if (test_accept_res && max_raw_tx_fee && fee > max_raw_tx_fee) {
960
- result_0.pushKV (" allowed" , false );
961
- result_0.pushKV (" reject-reason" , " max-fee-exceeded" );
962
- result.push_back (std::move (result_0));
963
- return result;
964
- }
965
- result_0.pushKV (" allowed" , test_accept_res);
966
-
967
958
// Only return the fee and vsize if the transaction would pass ATMP.
968
959
// These can be used to calculate the feerate.
969
960
if (test_accept_res) {
970
- result_0.pushKV (" vsize" , virtual_size);
971
- UniValue fees (UniValue::VOBJ);
972
- fees.pushKV (" base" , ValueFromAmount (fee));
973
- result_0.pushKV (" fees" , fees);
961
+ // Check that fee does not exceed maximum fee
962
+ if (max_raw_tx_fee && fee > max_raw_tx_fee) {
963
+ result_0.pushKV (" allowed" , false );
964
+ result_0.pushKV (" reject-reason" , " max-fee-exceeded" );
965
+ } else {
966
+ result_0.pushKV (" allowed" , true );
967
+ result_0.pushKV (" vsize" , virtual_size);
968
+ UniValue fees (UniValue::VOBJ);
969
+ fees.pushKV (" base" , ValueFromAmount (fee));
970
+ result_0.pushKV (" fees" , fees);
971
+ }
972
+ result.push_back (std::move (result_0));
974
973
} else {
975
- if (state.IsInvalid ()) {
976
- if (state.GetResult () == TxValidationResult::TX_MISSING_INPUTS) {
977
- result_0.pushKV (" reject-reason" , " missing-inputs" );
978
- } else {
979
- result_0.pushKV (" reject-reason" , strprintf (" %s" , state.GetRejectReason ()));
980
- }
974
+ result_0.pushKV (" allowed" , false );
975
+ if (state.GetResult () == TxValidationResult::TX_MISSING_INPUTS) {
976
+ result_0.pushKV (" reject-reason" , " missing-inputs" );
981
977
} else {
982
978
result_0.pushKV (" reject-reason" , state.GetRejectReason ());
983
979
}
980
+ result.push_back (std::move (result_0));
984
981
}
985
-
986
- result.push_back (std::move (result_0));
987
982
return result;
988
983
},
989
984
};
0 commit comments