Skip to content

Commit

Permalink
New chain
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockMechanic committed Jun 15, 2022
1 parent 2ddeb90 commit c07dd7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ class CTestNetParams : public CChainParams {
m_assumed_blockchain_size = 1;
m_assumed_chain_state_size = 1;

genesis = CreateGenesisBlock(1654632747, 2950320, 0x1e0ffff0, 1, 10 * COIN, consensus);
genesis = CreateGenesisBlock(1655262939, 79641, 0x1e0ffff0, 1, 10 * COIN, consensus);
consensus.hashGenesisBlock = genesis.GetHash();
//MineNewGenesisBlock(consensus,genesis);
assert(consensus.hashGenesisBlock == uint256S("0x000001c096bac29306db1534bc2563f497fcb7f4a5160a1067c78bc73e2a58a5"));
assert(consensus.hashGenesisBlock == uint256S("0x00000796921bd3ceba6547528ede4773f7482956158b44ad05ad9df57901af52"));
assert(genesis.hashMerkleRoot == uint256S("0x80ad356118a9ab8db192db66ef77146cc36d958f959251feace550e4ca3d1446"));

vFixedSeeds.clear();
Expand Down
6 changes: 4 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,8 @@ std::map<CTxDestination, std::vector<COutput>> CWallet::ListCoins() const

for (const COutput& coin : availableCoins) {
CTxDestination address;
if ((coin.fSpendable || (IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS) && coin.fSolvable)) &&
if (coin.fSpendable &&
//if ((coin.fSpendable || (IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS) && coin.fSolvable)) &&
ExtractDestination(FindNonChangeParentOutput(*coin.tx->tx, coin.i).scriptPubKey, address)) {
result[address].emplace_back(std::move(coin));
}
Expand Down Expand Up @@ -2662,7 +2663,7 @@ std::map<CTxDestination, std::vector<COutput>> CWallet::ListCoins() const
return result;
}

const CTxOutAsset& CWallet::FindNonChangeParentOutput(const CTransaction& tx, int output) const
const CTxOutAsset CWallet::FindNonChangeParentOutput(const CTransaction& tx, int output) const
{
AssertLockHeld(cs_wallet);
const CTransaction* ptx = &tx;
Expand All @@ -2678,6 +2679,7 @@ const CTxOutAsset& CWallet::FindNonChangeParentOutput(const CTransaction& tx, in
n = prevout.n;
}
return (ptx->nVersion >= TX_ELE_VERSION ? ptx->vpout[n] : ptx->vout[n]);

}

bool CWallet::SelectCoinsMinConf(const CAmountMap& mapTargetValue, const CoinEligibilityFilter& eligibility_filter, std::vector<OutputGroup> groups,
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
/**
* Find non-change parent output.
*/
const CTxOutAsset& FindNonChangeParentOutput(const CTransaction& tx, int output) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
const CTxOutAsset FindNonChangeParentOutput(const CTransaction& tx, int output) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);

/**
* Shuffle and select coins until nTargetValue is reached while avoiding
Expand Down

0 comments on commit c07dd7c

Please sign in to comment.