Try both TX serialization formats
This commit is contained in:
parent
08b8751559
commit
57d44d022e
1 changed files with 7 additions and 2 deletions
|
@ -233,8 +233,13 @@ func (r FutureCreateRawTransactionResult) Receive() (*wire.MsgTx, error) {
|
|||
|
||||
// Deserialize the transaction and return it.
|
||||
var msgTx wire.MsgTx
|
||||
if err := msgTx.Deserialize(bytes.NewReader(serializedTx)); err != nil {
|
||||
return nil, err
|
||||
// we try both the new and old encoding format
|
||||
witnessErr := msgTx.Deserialize(bytes.NewReader(serializedTx))
|
||||
if witnessErr != nil {
|
||||
legacyErr := msgTx.DeserializeNoWitness(bytes.NewReader(serializedTx))
|
||||
if legacyErr != nil {
|
||||
return nil, legacyErr
|
||||
}
|
||||
}
|
||||
return &msgTx, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue