MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / droptxfrommempool

Function droptxfrommempool

src/rpc/rpctx.cpp:1025–1049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023}
1024
1025Value 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
1051static vector<uint8_t> SignTxHash(const CKeyID &keyId, const uint256 &hash) {
1052 vector<uint8_t> signature;

Callers

nothing calls this directly

Calls 8

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
uint256SFunction · 0.85
JSONRPCErrorFunction · 0.85
ReScanMemPoolTxMethod · 0.80
sizeMethod · 0.45
IsEmptyMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected