net: create generic functor accessors and move vNodes to CConnman

This commit is contained in:
Cory Fields
2016-04-16 19:13:12 -04:00
parent c0569c7fa1
commit 53347f0cb9
7 changed files with 164 additions and 73 deletions

View File

@@ -891,8 +891,15 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
} else if (fHaveChain) {
throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain");
}
RelayTransaction(tx);
if(!g_connman)
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
CInv inv(MSG_TX, hashTx);
g_connman->ForEachNode([&inv](CNode* pnode)
{
pnode->PushInventory(inv);
return true;
});
return hashTx.GetHex();
}