Post
Topic
Board Development & Technical Discussion
Re: Preparing for wx --> qt switch
by
piotr_n
on 21/09/2011, 18:55:48 UTC
To save the further anguish I propose that anyone who wants to be treated seriously should explain how his proposed improvement will deal with the following pseudo-code (from wallet.cpp & ui.cpp):

CWallet::SendMoney() {
    grab_the_wallet_lock();
    solve_inverted_knapsack_problem_to_select_the_best_coin_subset();
    fee = compute_the_required_transaction_fee();
    yesno = ::ThreadSafeAskFee(fee);
    commit_transaction_and_release_lock(yesno);
}
This is how I see it:
 * grab_the_wallet_lock(); - not needed
 * solve_inverted_knapsack_problem_to_select_the_best_coin_subset() - not needed (see below)
 * fee = compute_the_required_transaction_fee() - just take the value from the user interface
 * yesno = ::ThreadSafeAskFee(fee) - useless (always answer 'yes - i'm sure what i set')
 * commit_transaction_and_release_lock(yesno) - this is the only thing you need to do. so you first talk to the wallet, saying that you want to send this money to this address. the wallet does the solve_inverted_knapsack_problem_to_select_the_best_coin_subset and returns you the signed transaction. then the UI app forwards it to the blockchain server.
and then you also need to resend to the blockchain server those transactions that have not been mined yet.
and also there are other things that you need to think about Smiley
but basically the idea of splitting it into a blockchain/transaction server, a wallet and a native GUI app seems to me the most reasonable to go with Smiley