Comments (5)
Thanks for the report. What server are you communicating with? I ask because I just tried this with btcd and it appears to work correctly:
// Try to get block that doesn't exist.
hash := &wire.ShaHash{}
block, err := client.GetBlock(hash)
if err != nil {
log.Fatalf("type: %T, error: %[1]v", err)
}
log.Print(block.Sha())
2015/07/11 23:19:45 type: *btcjson.RPCError, error: -5: Block not found
from btcrpcclient.
I'm using bitcoin-qt:
hash, err := wire.NewShaHashFromStr(rawTx.BlockHash)
block, err := client.GetBlock(hash)
if err != nil {
fmt.Println(reflect.TypeOf(err))
}
I'll try to look into it a bit more today.
from btcrpcclient.
Still seeing this issue, connecting locally using bitcoing-qt and also connecting to bitcoin core. Its a bit of a problem for me because it makes error detection harder. Any idea what might be the problem, or is this a core issue?
from btcrpcclient.
@scisci Still a problem? What version of go?
from btcrpcclient.
I was able to reproduce this and will submit a PR that fixes it shortly.
from btcrpcclient.
Related Issues (20)
- how to get the send address by TxID? HOT 1
- Remove -v to unclutter travis logs
- map[btcutil.Address]btcutil.Amount in sendmany is a pretty dangerous HOT 7
- Missing getmempoolentry HOT 3
- bip125-replaceable is missing in ListTransactionsResult HOT 1
- Parsing received notifications should not check for exact number of positional parameters HOT 1
- Variable coin symbol HOT 1
- Missing `gettxoutproof` HOT 1
- TransactionInput doesn't have a sequence HOT 1
- GetTransaction includeWatchOnly HOT 3
- OP_RETURN Transaction HOT 2
- New RPC Commands
- Errors when connecting via proxy HOT 7
- addwitnessaddress is missing HOT 1
- json: cannot unmarshal number -1 into Go struct field GetBlockVerboseResult.confirmations of type uint64
- client.GetBlockVerboseTx does not work with bitcoind
- Getting block by hash doesn't return height HOT 2
- ListSinceBlock and ListSinceBlockMinConf docs are dangerously wrong HOT 1
- getblockheader is not exposed HOT 3
- `GetBlockVerbose` is broken for bitcoin core HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btcrpcclient.