-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi: add valueIn parameter to wire.NewTxIn. #1287
Conversation
rpcserver.go
Outdated
@@ -648,8 +648,14 @@ func handleCreateRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan | |||
"or stake") | |||
} | |||
|
|||
utxo, err := s.chain.FetchUtxoEntry(txHash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the intended behavior of createrawtransaction
which is to also allow callers to create transactions for which utxos are not yet known. This information needs to be provided by the caller.
wire/msgtx_test.go
Outdated
@@ -102,10 +101,10 @@ func TestTx(t *testing.T) { | |||
0xa6, // 65-byte signature | |||
0xac, // OP_CHECKSIG | |||
} | |||
txOut := NewTxOut(txValue, pkScript) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change isn't really accurate. The output amount will almost never match the input amount. The difference is the fee. I don't think they should be tied together like this. It might make sense to do txValue := txIn.ValueIn - 1000
to simulate a fee and then leave all of these references as txValue
.
f14dc6d
to
180d35e
Compare
Small suggestion: I would reorder the parameters to make the signature:
The reason for this is that the prevOut and valueIn parameters will always be required and known by the caller, so they come first, while the signature script may not be immediately known (when creating a new unsigned transaction, for example). |
I agree with @jrick regarding the order. I would much prefer the required fields first and optional one last. |
This adds the valueIn parameter to wire.NewTxIn. Call sites and associated tests have also been updated.
This adds the valueIn parameter to wire.NewTxIn. Call sites and associated tests have also been updated.
Resolves #1279