@@ -41,7 +41,7 @@ func (t *TxnsDB) Put(raw []byte, txid, value string, height int, timestamp time.
41
41
return nil
42
42
}
43
43
44
- func (t * TxnsDB ) Get (txid chainhash. Hash ) (wallet.Txn , error ) {
44
+ func (t * TxnsDB ) Get (txid string ) (wallet.Txn , error ) {
45
45
t .lock .Lock ()
46
46
defer t .lock .Unlock ()
47
47
var txn wallet.Txn
@@ -55,7 +55,7 @@ func (t *TxnsDB) Get(txid chainhash.Hash) (wallet.Txn, error) {
55
55
var timestamp int
56
56
var value string
57
57
var watchOnlyInt int
58
- err = stmt .QueryRow (txid . String () , t .coinType .CurrencyCode ()).Scan (& raw , & value , & height , & timestamp , & watchOnlyInt )
58
+ err = stmt .QueryRow (txid , t .coinType .CurrencyCode ()).Scan (& raw , & value , & height , & timestamp , & watchOnlyInt )
59
59
if err != nil {
60
60
return txn , err
61
61
}
@@ -64,7 +64,7 @@ func (t *TxnsDB) Get(txid chainhash.Hash) (wallet.Txn, error) {
64
64
watchOnly = true
65
65
}
66
66
txn = wallet.Txn {
67
- Txid : txid . String () ,
67
+ Txid : txid ,
68
68
Value : value ,
69
69
Height : int32 (height ),
70
70
Timestamp : time .Unix (int64 (timestamp ), 0 ),
@@ -127,7 +127,7 @@ func (t *TxnsDB) Delete(txid *chainhash.Hash) error {
127
127
return nil
128
128
}
129
129
130
- func (t * TxnsDB ) UpdateHeight (txid chainhash. Hash , height int , timestamp time.Time ) error {
130
+ func (t * TxnsDB ) UpdateHeight (txid string , height int , timestamp time.Time ) error {
131
131
t .lock .Lock ()
132
132
defer t .lock .Unlock ()
133
133
@@ -136,7 +136,7 @@ func (t *TxnsDB) UpdateHeight(txid chainhash.Hash, height int, timestamp time.Ti
136
136
return fmt .Errorf ("prepare txn sql: %s" , err .Error ())
137
137
}
138
138
defer stmt .Close ()
139
- _ , err = stmt .Exec (height , int (timestamp .Unix ()), txid . String () , t .coinType .CurrencyCode ())
139
+ _ , err = stmt .Exec (height , int (timestamp .Unix ()), txid , t .coinType .CurrencyCode ())
140
140
if err != nil {
141
141
return fmt .Errorf ("update txns: %s" , err .Error ())
142
142
}
0 commit comments