Resolving bug with vout wrong sequence
This commit is contained in:
parent
6b67fe76a8
commit
9b047ae703
2 changed files with 6 additions and 6 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <graphene/peerplays_sidechain/bitcoin/libbitcoin_client.hpp>
|
||||
#include <graphene/peerplays_sidechain/common/rpc_client.hpp>
|
||||
#include <graphene/peerplays_sidechain/sidechain_net_handler.hpp>
|
||||
#include <graphene/peerplays_sidechain/bitcoin/libbitcoin_client.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
|
|
|||
|
|
@ -349,9 +349,8 @@ std::vector<info_for_vin> bitcoin_libbitcoin_client::getblock(const block_data &
|
|||
|
||||
const libbitcoin::chain::transaction::list trx_list = block.block.transactions();
|
||||
|
||||
uint32_t vout_seq = 0;
|
||||
|
||||
for (const auto &tx : trx_list) {
|
||||
uint32_t vout_seq = 0;
|
||||
for (const auto &o : tx.outputs()) {
|
||||
std::vector<std::string> address_list;
|
||||
|
||||
|
|
@ -378,10 +377,11 @@ std::vector<info_for_vin> bitcoin_libbitcoin_client::getblock(const block_data &
|
|||
// amount.erase(std::remove(amount.begin(), amount.end(), '.'), amount.end());
|
||||
// vin.out.amount = std::stoll(amount);
|
||||
vin.out.amount = o.value();
|
||||
vin.out.n_vout = vout_seq++;
|
||||
vin.out.n_vout = vout_seq;
|
||||
vin.address = address_base58;
|
||||
result.push_back(vin);
|
||||
}
|
||||
vout_seq++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -403,11 +403,11 @@ btc_tx bitcoin_libbitcoin_client::getrawtransaction(const std::string &txid, con
|
|||
tx.tx_txid = tx_hash;
|
||||
tx.tx_confirmations = confirmitions;
|
||||
|
||||
uint64_t tx_vout_index = 0;
|
||||
uint64_t tx_vout_sequence = 0;
|
||||
|
||||
for (auto &out : outs) {
|
||||
btc_txin tx_in;
|
||||
tx_in.tx_vout = tx_vout_index++;
|
||||
tx_in.tx_vout = tx_vout_sequence++;
|
||||
|
||||
libbitcoin::wallet::payment_address::list addresses;
|
||||
if (is_test_net) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue