| 1023 | } |
| 1024 | |
| 1025 | Value droptxfrommempool(const Array& params, bool fHelp) { |
| 1026 | if (fHelp || params.size() != 1) { |
| 1027 | throw runtime_error( |
| 1028 | "droptxfrommempool \"txid\"\n" |
| 1029 | "\ndrop tx from mem pool\n" |
| 1030 | "\nArguments:\n" |
| 1031 | "1.\"txid\": (string, required) the txid of dropping tx\n" |
| 1032 | "\nExamples:\n" + |
| 1033 | HelpExampleCli("droptxfrommempool", |
| 1034 | "\"c5287324b89793fdf7fa97b6203dfd814b8358cfa31114078ea5981916d7a8ac\"") + |
| 1035 | "\nAs json rpc call\n" + |
| 1036 | HelpExampleRpc("droptxfrommempool", |
| 1037 | "\"c5287324b89793fdf7fa97b6203dfd814b8358cfa31114078ea5981916d7a8ac\"")); |
| 1038 | } |
| 1039 | |
| 1040 | const string &txidStr = params[0].get_str(); |
| 1041 | |
| 1042 | uint256 txid = uint256S(txidStr); |
| 1043 | if (txid.IsEmpty()) |
| 1044 | throw JSONRPCError(RPC_INVALID_PARAMS, "Invalid txid=" + txidStr); |
| 1045 | |
| 1046 | mempool.Remove(txid); |
| 1047 | mempool.ReScanMemPoolTx(); |
| 1048 | return Object(); |
| 1049 | } |
| 1050 | |
| 1051 | static vector<uint8_t> SignTxHash(const CKeyID &keyId, const uint256 &hash) { |
| 1052 | vector<uint8_t> signature; |
nothing calls this directly
no test coverage detected