# Bet: Bet is finished but the winner cannot get XCP

**URL:** <https://forums.counterparty.io/t/bet-bet-is-finished-but-the-winner-cannot-get-xcp/644>\
**Category:** Counterparty\
**Created:** [December 29, 2014, 11:15am UTC](https://forums.counterparty.io/t/bet-bet-is-finished-but-the-winner-cannot-get-xcp/644 "2014-12-29T11:15:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zono](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/zono/32/47_2.png) [@zono](https://forums.counterparty.io/u/zono)\
**Post date:** [December 29, 2014, 11:15am UTC](https://forums.counterparty.io/t/bet-bet-is-finished-but-the-winner-cannot-get-xcp/644/1 "2014-12-29T11:15:08Z")

</div>

Hi, I tried to use betting API and it seems that escrow worked normally when players bet. However, after I broadcasted the result, the winner cannot get XCP from escrow.  

  

Do I need to do extra things to finish the bet?

  

What I did:

  

1. Before Brodocasting the game

  

Transaction

https://blockscan.com/tx?txhash=f2a822fa470a0798b331072fa95c1a0d753563fce873decd3cfec47305112e8f

  

Operator 1.20819997 XCP

PlayerX 0.05000001 XCP

PlayerY 0.05000000 XCP

  

2.After Betting

  

Transactions

https://blockscan.com/tx?txhash=00602c62059c2af5549646d6f1b0d8de1795fbcfa68892bdfcb5c70280f70a06

https://blockscan.com/tx?txhash=1b23d932cfb73a12dc0be593b95164c00524864ee21580c6bf799fd78ed9e045

  

Operator 1.20819997

PlayerX 0.05000000 // escrow worked properly.&nbsp;

PlayerY 0.04999997

  

3. After Brodocasting the game result

  

Transaction

https://blockscan.com/tx?txhash=a784ce9290153ea296e859385163690976955c1d333c82981c98e3162bc515d9

  

Operator 1.20819997 // not get operation fee. I expected that was ...? betting quantity was too small so I could not get the fee..?

PlayerX 0.05000000 // Winner but not get reward. I expected that was 0.05000004

PlayerY 0.04999997

  

Thanks,

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [December 29, 2014, 2:19pm UTC](https://forums.counterparty.io/t/bet-bet-is-finished-but-the-winner-cannot-get-xcp/644/2 "2014-12-29T14:19:51Z")

</div>

I think you want to broadcast a value (like “1”). Did you broadcast a value?&nbsp;

  

counterpartyd broadcast --source=BROADCASTADDRESS --text=“A vs. B - A=1, B=2” --value=2  

  

  

I think the bet has not been closed (i.e. value that you broadcast did not conclude/close it).

[https://blockscan.com/address/1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy](https://blockscan.com/address/1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy)  

  

Also can you use testnet perhaps, so that you can use regular values (it’s easier to follow questions if values are not tiny).

---

<div class="post-metadata">

**Author:** ![zono](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/zono/32/47_2.png) [@zono](https://forums.counterparty.io/u/zono)\
**Post date:** [December 29, 2014, 3:51pm UTC](https://forums.counterparty.io/t/bet-bet-is-finished-but-the-winner-cannot-get-xcp/644/3 "2014-12-29T15:51:00Z")

</div>

Hi, Yes, I did. But not sure if it is a proper way or not.

  

// Broadcast&nbsp;

curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create\_broadcast", "params":{"source":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "fee\_fraction":0.05, "text":"A vs. B - A=1, B=2", "timestamp":1419836433, "value":-1}}'

  

// Bet by playerA&nbsp;

curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create\_bet", "params":{"source":"1KMdf7VWLEBdCo9iwmtpW7kJaSzSAUz2zJ", "feed\_address":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "bet\_type":2, "deadline":1419937909, "wager\_quantity":1, "counterwager\_quantity":3, "target\_value":2, "expiration":120}}'

  

// Bet by playerB

curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create\_bet", "params":{"source":"143q1MJUTRgsaXEcU86f8mMx6UThZFfW1Y", "feed\_address":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "bet\_type":2, "deadline":1419937909, "wager\_quantity":3, "counterwager\_quantity":1, "target\_value":1, "expiration":120}}'

  

// Broadcast the result (The result is 2)

curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create\_broadcast", "params":{"source":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "fee\_fraction":0.05, "text":"A vs. B - A=1, B=2", "timestamp":1419842706, "value":2}}'

  

I have two questions.

  

1. When does the system change to close status? I expected that the trigger is sending a value except for -1 by the operate.&nbsp;

  

2. It seems that broadcast does not have ID. Of course tx\_hash is a unique key but it is not used when betting. My question is that is it possible to broadcast multiple broadcasts, like game-A and game-B, by one operator (same bitcoin address) ? I wonder how the system distinguish multiple broadcasts when player bet.

  

Regarding the testnet. Yes I will sync blockchain from now.

  

Thanks,

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [December 29, 2014, 6:16pm UTC](https://forums.counterparty.io/t/bet-bet-is-finished-but-the-winner-cannot-get-xcp/644/4 "2014-12-29T18:16:54Z")

</div>

@zono,

  

Testnet is very lightweight, it’s not a full copy of the blockchain so it’s not a problem to run.

  

Closed status is when a value (see “value” in here:&nbsp;[https://github.com/CounterpartyXCP/CommunityWiki/wiki/Enhanced-Feed-Info](https://github.com/CounterpartyXCP/CommunityWiki/wiki/Enhanced-Feed-Info)) that closes the feed is broadcast. On this URL you can see that values 1, 2 or 3 can close/decide.

  

I think you cannot broadcast multiple events because it would be hard to decide, but you can try on testnet, it’s free 🙂
