aboutsummaryrefslogtreecommitdiff
path: root/tests/core_proxy/core_proxy.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-08 15:55:03 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-08 15:55:03 -0500
commitbf525793c724f62d4716aaca59345ba2e13a2c3c (patch)
treead7ea60c6faf8ca103a686529fc1c716e272a9a5 /tests/core_proxy/core_proxy.cpp
parent0e4ab6091c6e65098775e7fd3864631c5568f8f4 (diff)
parent8330e772f1ed680a54833d25c4d17d09a99ab8d6 (diff)
downloadmonzero-core-bf525793c724f62d4716aaca59345ba2e13a2c3c.tar.gz
monzero-core-bf525793c724f62d4716aaca59345ba2e13a2c3c.tar.xz
monzero-core-bf525793c724f62d4716aaca59345ba2e13a2c3c.zip
Merge pull request #5915
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
Diffstat (limited to 'tests/core_proxy/core_proxy.cpp')
-rw-r--r--tests/core_proxy/core_proxy.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/core_proxy/core_proxy.cpp b/tests/core_proxy/core_proxy.cpp
index ed68f04e7..db5b7797a 100644
--- a/tests/core_proxy/core_proxy.cpp
+++ b/tests/core_proxy/core_proxy.cpp
@@ -160,7 +160,7 @@ string tx2str(const cryptonote::transaction& tx, const cryptonote::hash256& tx_h
return ss.str();
}*/
-bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay) {
+bool tests::proxy_core::handle_incoming_tx(const cryptonote::tx_blob_entry& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay) {
if (!keeped_by_block)
return true;
@@ -168,7 +168,13 @@ bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob,
crypto::hash tx_prefix_hash = null_hash;
transaction tx;
- if (!parse_and_validate_tx_from_blob(tx_blob, tx, tx_hash, tx_prefix_hash)) {
+ if (tx_blob.prunable_hash != crypto::null_hash)
+ {
+ cerr << "WRONG TRANSACTION, pruned blob rejected" << endl;
+ return false;
+ }
+
+ if (!parse_and_validate_tx_from_blob(tx_blob.blob, tx, tx_hash, tx_prefix_hash)) {
cerr << "WRONG TRANSACTION BLOB, Failed to parse, rejected" << endl;
return false;
}
@@ -176,7 +182,7 @@ bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob,
cout << "TX " << endl << endl;
cout << tx_hash << endl;
cout << tx_prefix_hash << endl;
- cout << tx_blob.size() << endl;
+ cout << tx_blob.blob.size() << endl;
//cout << string_tools::buff_to_hex_nodelimer(tx_blob) << endl << endl;
cout << obj_to_json_str(tx) << endl;
cout << endl << "ENDTX" << endl;
@@ -184,7 +190,7 @@ bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob,
return true;
}
-bool tests::proxy_core::handle_incoming_txs(const std::vector<blobdata>& tx_blobs, std::vector<tx_verification_context>& tvc, bool keeped_by_block, bool relayed, bool do_not_relay)
+bool tests::proxy_core::handle_incoming_txs(const std::vector<tx_blob_entry>& tx_blobs, std::vector<tx_verification_context>& tvc, bool keeped_by_block, bool relayed, bool do_not_relay)
{
tvc.resize(tx_blobs.size());
size_t i = 0;