fix: incorrect tx public key in outputs

results in incorrect tx details
https://github.com/moneroexamples/openmonero/issues/33
pull/30/head
moneroexamples 7 years ago
parent b58529ac12
commit 037d231c82

@ -51,7 +51,7 @@
</div>
<div class="received-div" ng-repeat="tx in transactions | limitTo:10">
<transaction></transaction>
</div>
</div>
</div>
<!--<script src="js/directives/qr_scanner.js?4"></script>-->

@ -61,10 +61,8 @@
</div>
</div>
<div class="received-div transaction-body lighter" ng-repeat="tx in transactions | orderBy:predicate:reverse | startFrom:pageNum*pageSize | limitTo:pageSize">
<div class="w-row" ng-click="toggle_tx_detail(tx)">
<transaction></transaction>
</div>
</div>
<a class="table-btn left pointer" ng-click="navigatePage(1)">&lt;&lt; Previous 10</a>
<a class="table-btn right pointer" ng-click="navigatePage(-1)">Next 10 &gt;&gt;</a>
</div>
</div>

@ -72,6 +72,7 @@ CREATE TABLE `Outputs` (
`rct_outpk` varchar(64) NOT NULL DEFAULT '',
`rct_mask` varchar(64) NOT NULL DEFAULT '',
`rct_amount` varchar(64) NOT NULL DEFAULT '',
`tx_pub_key` varchar(64) NOT NULL DEFAULT '',
`amount` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
`global_index` bigint(20) UNSIGNED NOT NULL,
`out_index` bigint(20) UNSIGNED NOT NULL DEFAULT '0',

@ -304,6 +304,7 @@ MysqlOutpus::insert(const XmrOutput& out_data)
SimpleResult sr = query.execute(out_data.account_id,
out_data.tx_id,
out_data.out_pub_key,
out_data.tx_pub_key,
out_data.rct_outpk,
out_data.rct_mask,
out_data.rct_amount,

@ -280,6 +280,7 @@ TxSearch::search()
out_data.account_id = acc->id;
out_data.tx_id = tx_mysql_id;
out_data.out_pub_key = out_info.pub_key;
out_data.tx_pub_key = oi_identification.tx_pub_key_str;
out_data.amount = out_info.amount;
out_data.out_index = out_info.idx_in_tx;
out_data.rct_outpk = out_info.rtc_outpk;

@ -224,7 +224,7 @@ YourMoneroRequests::get_address_txs(const shared_ptr< Session > session, const B
j_spent_outputs.push_back({
{"amount" , input.amount},
{"key_image" , input.key_image},
{"tx_pub_key" , tx.tx_pub_key},
{"tx_pub_key" , out.tx_pub_key},
{"out_index" , out.out_index},
{"mixin" , out.mixin}});
}
@ -408,7 +408,7 @@ YourMoneroRequests::get_address_info(const shared_ptr< Session > session, const
j_spent_outputs.push_back({
{"amount" , in.amount},
{"key_image" , in.key_image},
{"tx_pub_key" , tx.tx_pub_key},
{"tx_pub_key" , out.tx_pub_key},
{"out_index" , out.out_index},
{"mixin" , out.mixin},
});

@ -73,6 +73,7 @@ XmrOutput::to_json() const
{"account_id" , account_id},
{"tx_id" , tx_id},
{"out_pub_key" , out_pub_key},
{"tx_pub_key" , tx_pub_key},
{"amount" , amount},
{"global_index" , global_index},
{"out_index" , out_index},

@ -153,7 +153,7 @@ struct XmrTransaction : public Transactions, Table
};
sql_create_12(Outputs, 1, 3,
sql_create_13(Outputs, 1, 3,
sql_bigint_unsigned, id,
sql_bigint_unsigned, account_id,
sql_bigint_unsigned, tx_id,
@ -161,6 +161,7 @@ sql_create_12(Outputs, 1, 3,
sql_varchar , rct_outpk,
sql_varchar , rct_mask,
sql_varchar , rct_amount,
sql_varchar , tx_pub_key,
sql_bigint_unsigned, amount,
sql_bigint_unsigned, global_index,
sql_bigint_unsigned, out_index,
@ -188,6 +189,7 @@ struct XmrOutput : public Outputs, Table
static constexpr const char* INSERT_STMT = R"(
INSERT IGNORE INTO `Outputs` (`account_id`, `tx_id`, `out_pub_key`,
`tx_pub_key`,
`rct_outpk`, `rct_mask`, `rct_amount`,
`amount`, `global_index`,
`out_index`, `mixin`, `timestamp`)
@ -195,7 +197,7 @@ struct XmrOutput : public Outputs, Table
%3q,
%4q, %5q, %6q,
%7q, %8q,
%9q, %10q);
%9q, %10q, %11q);
)";

Loading…
Cancel
Save