Consolidate CTransaction hex encode/decode into core_io.h, core_{read,write}.cpp

This commit is contained in:
Jeff Garzik
2014-06-23 23:10:24 -04:00
parent 2920322871
commit ae775b5b31
7 changed files with 73 additions and 33 deletions

15
src/core_write.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "core_io.h"
#include "core.h"
#include "serialize.h"
#include "util.h"
using namespace std;
string EncodeHexTx(const CTransaction& tx)
{
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << tx;
return HexStr(ssTx.begin(), ssTx.end());
}