File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 15
15
#include < core_io.h>
16
16
#include < policy/feerate.h>
17
17
#include < policy/policy.h>
18
+ #include < policy/rbf.h>
18
19
#include < primitives/transaction.h>
19
20
#include < rpc/server.h>
20
21
#include < streams.h>
@@ -376,7 +377,8 @@ std::string EntryDescriptionString()
376
377
" ... ]\n "
377
378
" \" spentby\" : [ (array) unconfirmed transactions spending outputs from this transaction\n "
378
379
" \" transactionid\" , (string) child transaction id\n "
379
- " ... ]\n " ;
380
+ " ... ]\n "
381
+ " \" bip125-replaceable\" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)\n " ;
380
382
}
381
383
382
384
void entryToJSON (UniValue &info, const CTxMemPoolEntry &e)
@@ -419,6 +421,17 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e)
419
421
}
420
422
421
423
info.pushKV (" spentby" , spent);
424
+
425
+ // Add opt-in RBF status
426
+ bool rbfStatus = false ;
427
+ RBFTransactionState rbfState = IsRBFOptIn (tx, mempool);
428
+ if (rbfState == RBFTransactionState::UNKNOWN) {
429
+ throw JSONRPCError (RPC_MISC_ERROR, " Transaction is not in mempool" );
430
+ } else if (rbfState == RBFTransactionState::REPLACEABLE_BIP125) {
431
+ rbfStatus = true ;
432
+ }
433
+
434
+ info.pushKV (" bip125-replaceable" , rbfStatus);
422
435
}
423
436
424
437
UniValue mempoolToJSON (bool fVerbose )
You can’t perform that action at this time.
0 commit comments