Eliminate nonsense logic during contract negotiation#3150
Eliminate nonsense logic during contract negotiation#3150huetsch wants to merge 2 commits intoNebulousLabs:masterfrom
Conversation
… siacoin output indices when negotiating file contract formation
|
I believe that logic is there to enable the same thing that you just changed in If you merge this code, any attempt to eliminate the setup transaction would break compatibility with upgraded nodes. |
|
Ahh, so the idea is that you could add refund outputs when forming a file contract. That hadn't occurred to me. And yet, treating Siafund inputs as Siacoin outputs - your I'll come back to this a little later and take a stab at directly setting up the optimized refund transactions in one go. |
This one left me scratching my head for a couple days.
The 3rd field returned by
TransactionBuilder.ViewAdded()is a slice of SiafundInput indices.When the host sets up the collateral transaction, the code was taking this (empty) list of SiafundInputs indices and treating them as SiacoinOutput indices. The host was then gathering up an empty slice of SiacoinOutputs based on these indices and sending it back to the renter, which was trying to put them into the final transaction to be submitted to the blockchain with the FileContract.
None of it really makes any sense to me, as there shouldn't be any SiacoinOutputs in that FileContract transaction.
The code was harmless in execution but it should be eliminated from the codebase because it is very confusing.