add testing sighash folder

This commit is contained in:
Tadge Dryja committed 2016-02-19 14:49:04 -08:00
1 parent d8e62f6898
commit 233ec9538c
4 files changed
+120

No files matched your search

+1
View File
@@ -226,6 +226,7 @@ func (s *SPVCon) SendCoins(adr btcutil.Address, sendAmt int64) error {
return nil
}
// SignThis isn't used anymore...
func (t *TxStore) SignThis(tx *wire.MsgTx) error {
fmt.Printf("-= SignThis =-\n")
+25
View File
@@ -185,6 +185,20 @@ func outPointToBytes(op *wire.OutPoint) ([]byte, error) {
return buf.Bytes(), nil
}
/*----- serialization for utxos ------- */
/* Utxos serialization:
byte length desc at offset
32 txid 0
4 idx 32
4 height 36
4 keyidx 40
8 amt 44
1 flag 52
end len 53
*/
// ToBytes turns a Utxo into some bytes.
// note that the txid is the first 36 bytes and in our use cases will be stripped
// off, but is left here for other applications
@@ -278,6 +292,17 @@ func UtxoFromBytes(b []byte) (Utxo, error) {
return u, nil
}
/*----- serialization for stxos ------- */
/* Stxo serialization:
byte length desc at offset
53 utxo 0
4 sheight 53
32 stxid 57
end len 89
*/
// ToBytes turns an Stxo into some bytes.
// prevUtxo serialization, then spendheight [4], spendtxid [32]
func (s *Stxo) ToBytes() ([]byte, error) {