MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / OrphanToJSON

Function OrphanToJSON

src/rpc/mempool.cpp:1241–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239}
1240
1241static UniValue OrphanToJSON(const node::TxOrphanage::OrphanInfo& orphan)
1242{
1243 UniValue o(UniValue::VOBJ);
1244 o.pushKV("txid", orphan.tx->GetHash().ToString());
1245 o.pushKV("wtxid", orphan.tx->GetWitnessHash().ToString());
1246 o.pushKV("bytes", orphan.tx->ComputeTotalSize());
1247 o.pushKV("vsize", GetVirtualTransactionSize(*orphan.tx));
1248 o.pushKV("weight", GetTransactionWeight(*orphan.tx));
1249 UniValue from(UniValue::VARR);
1250 for (const auto fromPeer: orphan.announcers) {
1251 from.push_back(fromPeer);
1252 }
1253 o.pushKV("from", from);
1254 return o;
1255}
1256
1257static RPCMethod getorphantxs()
1258{

Callers 1

getorphantxsFunction · 0.85

Calls 7

GetTransactionWeightFunction · 0.85
pushKVMethod · 0.80
ComputeTotalSizeMethod · 0.80
ToStringMethod · 0.45
GetHashMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected