aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_basic.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-09-15 15:19:54 +0200
committerRiccardo Spagni <ric@spagni.net>2016-09-15 15:19:54 +0200
commitce5367452063e4e74e8a690d876274b9395eef69 (patch)
tree447161d53d5f86eb435df8b924dfeeca18373c2b /src/cryptonote_core/cryptonote_basic.h
parentMerge pull request #1066 (diff)
parentwallet: fix misdetection of duplicates (diff)
downloadmonero-ce5367452063e4e74e8a690d876274b9395eef69.tar.xz
Merge pull request #1067
70b78bb wallet: fix misdetection of duplicates (moneromooo-monero) 7d413f6 rct: rework serialization to avoid storing vector sizes (moneromooo-monero) 0ce79ef core: cleanup some typecasting (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/cryptonote_basic.h')
-rw-r--r--src/cryptonote_core/cryptonote_basic.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h
index f54b8c2b3..da069a21a 100644
--- a/src/cryptonote_core/cryptonote_basic.h
+++ b/src/cryptonote_core/cryptonote_basic.h
@@ -230,24 +230,22 @@ namespace cryptonote
}
else
{
- FIELD(rct_signatures)
- switch (rct_signatures.type)
+ ar.tag("rct_signatures");
+ if (!vin.empty())
{
- case rct::RCTTypeNull:
- break;
- case rct::RCTTypeSimple:
- if (rct_signatures.mixRing.size() && rct_signatures.mixRing.size() != vin.size())
- return false;
- break;
- case rct::RCTTypeFull:
- for (size_t i = 0; i < rct_signatures.mixRing.size(); ++i)
+ ar.begin_object();
+ bool r = rct_signatures.serialize_rctsig_base(ar, vin.size(), vout.size());
+ if (!r || !ar.stream().good()) return false;
+ ar.end_object();
+ if (rct_signatures.type != rct::RCTTypeNull)
{
- if (rct_signatures.mixRing[i].size() != vin.size())
- return false;
+ ar.tag("rctsig_prunable");
+ ar.begin_object();
+ r = rct_signatures.p.serialize_rctsig_prunable(ar, rct_signatures.type, vin.size(), vout.size(),
+ vin[0].type() == typeid(txin_to_key) ? boost::get<txin_to_key>(vin[0]).key_offsets.size() - 1 : 0);
+ if (!r || !ar.stream().good()) return false;
+ ar.end_object();
}
- break;
- default:
- return false;
}
}
END_SERIALIZE()