the premine now works and is spendable; transfers are now working correctly

This commit is contained in:
Some Random Crypto Guy
2023-10-18 19:59:59 +01:00
parent 0b3633ccdc
commit 8e2c6a81df
27 changed files with 151 additions and 87 deletions
+10 -7
View File
@@ -1275,12 +1275,15 @@ namespace cryptonote
return true;
}
if (req.do_sanity_checks && !cryptonote::tx_sanity_check(tx_blob, m_core.get_blockchain_storage().get_num_mature_outputs(0)))
{
res.status = "Failed";
res.reason = "Sanity check failed";
res.sanity_check_failed = true;
return true;
uint64_t output_count = m_core.get_blockchain_storage().get_num_mature_outputs(req.source_asset_type);
bool ok = cryptonote::tx_sanity_check(tx_blob, output_count);
if (!ok) {
if (req.do_sanity_checks && !cryptonote::tx_sanity_check(tx_blob, output_count)) {
res.status = "Failed";
res.reason = "Sanity check failed";
res.sanity_check_failed = true;
return true;
}
}
res.sanity_check_failed = false;
@@ -3359,7 +3362,7 @@ namespace cryptonote
return true;
}
res.distributions.push_back({std::move(*data), amount, "", req.binary, req.compress});
res.distributions.push_back({std::move(*data), amount, req.rct_asset_type, req.binary, req.compress});
}
}
catch (const std::exception &e)
+3
View File
@@ -602,12 +602,14 @@ namespace cryptonote
struct request_t: public rpc_access_request_base
{
std::string tx_as_hex;
std::string source_asset_type;
bool do_not_relay;
bool do_sanity_checks;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_PARENT(rpc_access_request_base);
KV_SERIALIZE(tx_as_hex)
KV_SERIALIZE(source_asset_type)
KV_SERIALIZE_OPT(do_not_relay, false)
KV_SERIALIZE_OPT(do_sanity_checks, true)
END_KV_SERIALIZE_MAP()
@@ -2493,6 +2495,7 @@ namespace cryptonote
uint64_t from_height;
uint64_t to_height;
std::string rct_asset_type;
bool cumulative;
bool binary;
bool compress;