Correctly implement the outputBackChange: Take care of sending all the remaining sources from the issuer’s wallet
As discussed in #247 (closed), we discovered that the outputbackchange feature has never been correctly designed and does not work as expected.
It is supposed to send the rest of the sources from the issuer’s wallet to the outputbackchange address. But it simply send the rest of the selected source.
I can prove it with following:
silkaj -p localhost:10902 -af --file authfile_moul-test tx --amount 2 --output GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP --outputBackChange WULdRTxspGdJzrs4vpZsWLGWsu37DjqoHyhGDFr5amh
╒════════════════════════════╤══════════════════════════════════════════════╕
│ pubkey’s balance before tx │ 229795.83 ĞTest │
├────────────────────────────┼──────────────────────────────────────────────┤
│ tx amount (unit) │ 2.0 ĞTest │
├────────────────────────────┼──────────────────────────────────────────────┤
│ tx amount (relative) │ 0.0011 UD ĞTest │
├────────────────────────────┼──────────────────────────────────────────────┤
│ pubkey’s balance after tx │ 229793.83 ĞTest │
├────────────────────────────┼──────────────────────────────────────────────┤
│ from (pubkey) │ 5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH │
├────────────────────────────┼──────────────────────────────────────────────┤
│ from (id) │ moul-test │
├────────────────────────────┼──────────────────────────────────────────────┤
│ to (pubkey) │ GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP │
├────────────────────────────┼──────────────────────────────────────────────┤
│ Backchange (pubkey) │ WULdRTxspGdJzrs4vpZsWLGWsu37DjqoHyhGDFr5amh │
├────────────────────────────┼──────────────────────────────────────────────┤
│ comment │ │
╘════════════════════════════╧══════════════════════════════════════════════╛
Do you confirm sending this transaction? [yes/no]: yes
Generate Transaction:
- From: 5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH
- To: GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP
- Amount: 2.0
Version: 10
Type: Transaction
Currency: g1-test
Blockstamp: 442412-00005E4878841CC05E09C66AA1D890063F4B30FE0C65F920E9BF860605ED56E5
Locktime: 0
Issuers:
5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH
Inputs:
1085:3:D:5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH:405569
Unlocks:
0:SIG(0)
Outputs:
2:2:SIG(GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP)
10848:2:SIG(WULdRTxspGdJzrs4vpZsWLGWsu37DjqoHyhGDFr5amh)
Comment:
NKRIMZGTv80oJDNNoZnEqbmYwThXtu6EStEBtFah8//j22mGxusGKU2ItlP/Pz/j9whRMtT5SLYwPKOZWramBQ==
This feature should be implemented. I am sorry Tortue, you went to fast that time.