mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-23 06:45:21 +01:00
Applying stash
This commit is contained in:
parent
578e18f53d
commit
9fe50e670d
1 changed files with 20 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
|||
package org.scalacoin.crypto
|
||||
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializerHelper
|
||||
import org.scalacoin.marshallers.transaction.RawTransactionOutputParser
|
||||
import org.scalacoin.protocol.script.{ScriptPubKeyFactory, ScriptPubKey}
|
||||
import org.scalacoin.protocol.transaction.{Transaction, TransactionOutput, TransactionInput}
|
||||
import org.scalacoin.script.constant.ScriptToken
|
||||
|
@ -20,10 +21,8 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper {
|
|||
* @param script
|
||||
* @return
|
||||
*/
|
||||
def serializeScriptCode(script : Seq[ScriptToken]) : String = {
|
||||
val serializedScript : String = removeOpCodeSeparators(script)
|
||||
serializedScript
|
||||
}
|
||||
def serializeScriptCode(script : Seq[ScriptToken]) : String = removeOpCodeSeparators(script)
|
||||
|
||||
|
||||
def serializeInput(input : TransactionInput, nType : Int, nVersion : Int) : String = ???
|
||||
|
||||
|
@ -35,7 +34,23 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper {
|
|||
* @param nVersion
|
||||
* @return
|
||||
*/
|
||||
def serializeOutput(output : TransactionOutput, nType : Int, nVersion : Int) : String = ???
|
||||
def serializeOutput(output : TransactionOutput, nType : Int, nVersion : Int,
|
||||
hashType : HashType, inputIndex : Int, outputIndex : Int ) : String = {
|
||||
//check if it is a SIGHASH_SINGLE
|
||||
//check if the output index is not the same as the input index
|
||||
//
|
||||
if (hashType == SIGHASH_SINGLE && inputIndex != outputIndex) {
|
||||
// Do not lock-in the txout payee at other indices as txin
|
||||
//::Serialize(s, CTxOut(), nType, nVersion)
|
||||
//need to write an empty output i think
|
||||
} else {
|
||||
//::Serialize(s, txTo.vout[nOutput], nType, nVersion);
|
||||
RawTransactionOutputParser.write(output)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
def serialize(spendingTransaction : Transaction, nIn : Int, nType : Int, nVersion : Int, nHashTypeIn : HashType) : String = {
|
||||
val serializedVersion =spendingTransaction.version.toHexString
|
||||
|
|
Loading…
Add table
Reference in a new issue