@@ -1363,6 +1363,57 @@ Value omni_listtransactions(const Array& params, bool fHelp)
13631363 return response;
13641364}
13651365
1366+ Value omni_listpendingtransactions (const Array& params, bool fHelp )
1367+ {
1368+ if (fHelp || params.size () > 1 )
1369+ throw runtime_error (
1370+ " omni_listpendingtransactions ( \" address\" )\n "
1371+ " \n Returns a list of unconfirmed Omni transactions, pending in the memory pool.\n "
1372+ " \n An optional filter can be provided to only include transactions which involve the given address.\n "
1373+ " \n Note: the validity of pending transactions is uncertain, and the state of the memory pool may "
1374+ " change at any moment. It is recommended to check transactions after confirmation, and pending "
1375+ " transactions should be considered as invalid.\n "
1376+ " \n Arguments:\n "
1377+ " 1. address (string, optional) address filter (default: \"\" for no filter)\n "
1378+ " \n Result:\n "
1379+ " [ (array of JSON objects)\n "
1380+ " {\n "
1381+ " \" txid\" : \" hash\" , (string) the hex-encoded hash of the transaction\n "
1382+ " \" sendingaddress\" : \" address\" , (string) the Bitcoin address of the sender\n "
1383+ " \" referenceaddress\" : \" address\" , (string) a Bitcoin address used as reference (if any)\n "
1384+ " \" ismine\" : true|false, (boolean) whether the transaction involes an address in the wallet\n "
1385+ " \" fee\" : \" n.nnnnnnnn\" , (string) the transaction fee in bitcoins\n "
1386+ " \" version\" : n, (number) the transaction version\n "
1387+ " \" type_int\" : n, (number) the transaction type as number\n "
1388+ " \" type\" : \" type\" , (string) the transaction type as string\n "
1389+ " [...] (mixed) other transaction type specific properties\n "
1390+ " },\n "
1391+ " ...\n "
1392+ " ]\n "
1393+ " \n Examples:\n "
1394+ + HelpExampleCli (" omni_listpendingtransactions" , " " )
1395+ + HelpExampleRpc (" omni_listpendingtransactions" , " " )
1396+ );
1397+
1398+ std::string filterAddress;
1399+ if (params.size () > 0 ) {
1400+ filterAddress = ParseAddressOrEmpty (params[0 ]);
1401+ }
1402+
1403+ std::vector<uint256> vTxid;
1404+ mempool.queryHashes (vTxid);
1405+
1406+ Array result;
1407+ BOOST_FOREACH (const uint256& hash, vTxid) {
1408+ Object txObj;
1409+ if (populateRPCTransactionObject (hash, txObj, filterAddress) == 0 ) {
1410+ result.push_back (txObj);
1411+ }
1412+ }
1413+
1414+ return result;
1415+ }
1416+
13661417Value omni_getinfo (const Array& params, bool fHelp )
13671418{
13681419 if (fHelp || params.size () != 0 )
0 commit comments